Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Error with SELECT and MySQL

by MZSanford (Curate)
on Jul 05, 2001 at 11:10 UTC ( [id://94026]=note: print w/replies, xml ) Need Help??


in reply to Error with SELECT and MySQL

While a fix for your error has been provided, i would like to briefly cover the cause ... so it does not happen to you over and over.

When you run your select statement, you only read one line of the result. When calling disconnect() if there are any statement handles which have data waiting, you get the invalidates X active statement handle(s) message. So, the rason one worked and the other did not is because one query had a singl result line, while the other had multiple.

If you only want one line, regardless of the number returned, $sth->finish() is a fix, but sometimes, it hides the issue of truncating result sets.


may the foo be with you

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-26 00:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found