Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Ordering return from fetchrow_hashref

by gmax (Abbot)
on Mar 02, 2004 at 17:18 UTC ( #333308=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while (my $rec = $sth->fetchrow_hashref()) {
        print $rec->{xy}, $rec->{xz}, $rec->{yz};
    }
    
  2. or download this
    while (my $row = $sth->fetchrow_hashref()) {
        print map( { "$_ => $row->{$_}\t"} @{$sth->{NAME}}),  "\n";
    ...
        }
        print "\n";
    }
    
  3. or download this
    while (my $row = $sth->fetchrow_arrayref()) { # arrayref, not hash
        my $index = 0;
    ...
        }
        print "\n";
    }
    
  4. or download this
    my $aref = $sth->fetchall_arrayref({});
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://333308]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2019-11-15 06:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (80 votes). Check out past polls.

    Notices?