Let's assume that the $sth->prepare() was good but something failed at
this line:

$sth = $dbh->exeute();

if($sth) is not consistent when connection or something goes bad.

Can you or someone comment further about testing $sth if there are rows?


-thanks

> 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.
>
>



-----------------------------------------
eMail solutions by 
http://www.swanmail.com

Reply via email to