Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: if (empty record set)

by hardburn (Abbot)
on Jun 26, 2003 at 14:55 UTC ( [id://269255]=note: print w/replies, xml ) Need Help??


in reply to if (empty record set)

Instead of using $sth->fetchrow(), call $sth->rows() instead, which returns the number of rows that were hit:

my $SQLString "select this, that from there"; $sth = $dbh->prepare($SQLString); $sth->execute(); if($sth->rows() == 0) { ........... }

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

Note: All code is untested, unless otherwise stated

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-24 06:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found