There's more than one way to do things | |
PerlMonks |
Re: Error with SELECT and MySQLby MZSanford (Curate) |
on Jul 05, 2001 at 11:10 UTC ( [id://94026]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Seekers of Perl Wisdom
|
|