in reply to Re: fetchrow_array
in thread fetchrow_array
Alternatively you can use bind_columns to do this (except row by row instead of all at once). From the docs (prepare something like "select region, sales from table"):
$sth->execute; my %row; $sth->bind_columns( \( @row{ @{$sth->{NAME_lc} } } )); while ($sth->fetch) { print "$row{region}: $row{sales}\n"; }
Updated: Added better reference to documentation
"Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: fetchrow_array
by bradcathey (Prior) on May 27, 2005 at 16:02 UTC | |
by kutsu (Priest) on May 27, 2005 at 16:36 UTC | |
by injunjoel (Priest) on May 27, 2005 at 18:26 UTC |
In Section
Seekers of Perl Wisdom