in reply to Re^3: DBI hashref does not return data in order of query
in thread DBI hashref does not return data in order of query
In another section, I use XML::Generator, like this. Maybe somehow I can loop through so the right amount of columns are created in this hash, and it's generated on it's own. UNLESS it's possible to get the column names in the element tags using the above array solution, I just can't see it. :(my @xml_array = (); while ( my $row = $sth->fetchrow_arrayref ) { push @xml_array, $row; } my $cgi = CGI->new; print $cgi->header('text/xml'); print Dumper( \@xml_array ); my $testxml = XMLout( \@xml_array, NoAttr => 1, RootName => 'datas +et', ); print $testxml;
$xml->cdr( $xml->Date($date_time), $xml->IngressTG($orig_gw), $xml->EgressTG($term_gw), $xml->Dialed($call_dtmf), $xml->DUR($duration), $xml->PDD($hold_time), $xml->ISDN($isdn), $xml->CallType($call_type), $xml->Link("URL") );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: DBI hashref does not return data in order of query
by tuxz0r (Pilgrim) on Oct 23, 2007 at 14:20 UTC | |
by hallikpapa (Scribe) on Oct 23, 2007 at 17:18 UTC |