Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: no rows returned for dbi fetchall_arrayref

by ruzam (Curate)
on May 08, 2013 at 04:08 UTC ( #1032572=note: print w/ replies, xml ) Need Help??


in reply to no rows returned for dbi fetchall_arrayref

fetchall_arrayref returns zero if the query failed

my $result_array = $sth->fetchall_arrayref; if (!$result_array) { print "query failed!!\n"; }

If no rows are found (the query is successful, but no rows are returned) fetchall_arrayref returns a reference to an empty array.

my $result_array = $sth->fetchall_arrayref; if ($result_array) { print "success\n"; if (@$result_array) { print "found rows @$result_array\n"; } else { print "no rows returned\n"; } } else { print "query failed!!\n"; }


Comment on Re: no rows returned for dbi fetchall_arrayref
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2015-07-02 02:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (25 votes), past polls