Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: DBI fetch array

by busunsl (Vicar)
on Oct 21, 2002 at 08:42 UTC ( [id://206792]=note: print w/replies, xml ) Need Help??


in reply to DBI fetch array

From perldoc DBI (highlighting by me):

$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.
To fetch all rows, use $dbh->selectall_arrayref.

Or in your case, where there is only one column:

my @rows = @{$dbh->selectcol_arrayref($sql)};

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://206792]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2024-04-16 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found