in reply to DBI and fetching data
$i++ while $output[$i] = [ $sql->fetchrow_array ];
That loop never terminates. A reference is *always* true, even a reference to an empty array. However, you could write something like (I don't have DBI on the machine I'm currently working on, so this is untested):
my $output = $sql -> fetchall_arrayref; # Or my @output = @{$sql -> fetchall_arrayref};
If you are going to collect all results in a big array, let the DBI do the work for you.
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: DBI and fetching data
by Melly (Chaplain) on Sep 12, 2003 at 09:09 UTC | |
by cchampion (Curate) on Sep 12, 2003 at 09:32 UTC |