in reply to DBI fetch array
To fetch all rows, use $dbh->selectall_arrayref.$hash_ref = $sth->fetchrow_hashref; An alternative to `fetchrow_arrayref'. Fetches the **next row** of data and returns it as a reference to a hash containing field name and field value pairs. Null fields are returned as `undef' values in the hash.
Or in your case, where there is only one column:
my @rows = @{$dbh->selectcol_arrayref($sql)};
|
|---|