in reply to Saving sql results to an array all rows?
you just take the first field out of each record, ignoring the rest.($line) = $sth->fetchrow_array()
aswhile (($line) = $sth->fetchrow_array()) { push(@all_rows, $line); } foreach (@all_rows) { print "$_\n"; }
while ( (@record) = $sth->fetchrow_array()) { push(@all_rows, \@record); } foreach my $row_ref (@all_rows) { print "@{$row_ref}\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Saving sql results to an array all rows?
by learningperl01 (Beadle) on Aug 18, 2008 at 17:33 UTC | |
by Krambambuli (Curate) on Aug 18, 2008 at 19:27 UTC | |
by learningperl01 (Beadle) on Aug 19, 2008 at 15:26 UTC | |
by Krambambuli (Curate) on Aug 19, 2008 at 16:12 UTC | |
by learningperl01 (Beadle) on Aug 20, 2008 at 12:58 UTC | |
|