Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Re: Re: Sqlite DBI $sth->rows

by bart (Canon)
on Oct 24, 2003 at 00:35 UTC ( [id://301759]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Sqlite DBI $sth->rows
in thread Sqlite DBI $sth->rows

my $sql = { SELECT count(*) FROM patient_data WHERE name = ? }; my $sth = $dbh->prepare($sql); $sth->execute($name); my ($count_rows) = $sth->fetchrow_array();
Note that this is not complete without a finish() call:
$sth->finish();
You need to use finish if you don't repeat calling fetchrow_*, or equivalent, until it returns undef. So you need it in your second example, too.

If you omit it, you'll get a warning from DBI, or you should. (Maybe this depends on the database driver?)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-04-23 10:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found