in reply to perl DBI question about fetchrow_arrayref()
Your question says "fetchrow_arrayref", but in your example you are using fetchrow_array.
Maybe that's why it doesn't work ??
Update: As per the sabari Answer which is correct, here's what you need
ORmy $list = $db->prepare("SELECT * FROM `table`"); $list->execute(); my @array; while ( my $ref = $list->fetchrow_arrayref() ) { push @array,[@$ref]; } foreach (@array) { print @{ $_ },"\n"; }
my @array; while ( my @arr = $list->fetchrow_array() ) { push @array,\@arr; } foreach (@array) { print @{ $_ },"\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: perl DBI question about fetchrow_arrayref()
by sabari (Beadle) on Apr 25, 2010 at 08:06 UTC | |
by lightoverhead (Pilgrim) on Apr 25, 2010 at 09:46 UTC | |
|
Re^2: perl DBI question about fetchrow_arrayref()
by lightoverhead (Pilgrim) on Apr 25, 2010 at 09:48 UTC | |
|
Re^2: perl DBI question about fetchrow_arrayref()
by Anonymous Monk on Apr 25, 2010 at 13:54 UTC | |
by ikegami (Patriarch) on Apr 25, 2010 at 16:36 UTC |