in reply to Re^2: DBI hashref does not return data in order of query
in thread DBI hashref does not return data in order of query
It has already been said: use fetchrow_arrayref
I suppose this is what you want:
my @ordered_values = (); while (my $row = $sth->fetchrow_arrayref) { push @ordered_values, [@$row]; } print "-- DBI says:\n"; print XMLout( \@ordered_values, NoAttr=>1, RootName=>'dataset', ); print "\n"; print "-- dumper says:\n"; print Dumper(\@names); print Dumper(\@ordered_values);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: DBI hashref does not return data in order of query
by hallikpapa (Scribe) on Oct 28, 2007 at 23:46 UTC | |
by erix (Prior) on Oct 29, 2007 at 01:05 UTC | |
by hallikpapa (Scribe) on Oct 29, 2007 at 03:51 UTC |