On Wed, 22 Oct 2003 22:18:18 -0700 (PDT) [EMAIL PROTECTED] wrote: > How can I test the status of $sth itself? > > A scenario is that a $sth is passed from a sub. And now, I have a > $sth. Of course $sth->rows return 0 or whatever int row. However, a > test using $sth->rows is not good when something is wrong. It return > some large number. So How can I test to see if its bad or good > without access to previous calls?
If the $dbh->prepare() call failed, $sth will be false. The only portable way to tell if $sth will return rows is to fetch some. -- Mac :}) ** I usually forward private questions to the appropriate mail list. ** Ask Smarter: http://www.catb.org/~esr/faqs/smart-questions.html Give a hobbit a fish and he eats fish for a day. Give a hobbit a ring and he eats fish for an age.
