DB error
| From: | Massimiliano Arione | Date: | Tue, 22 Nov 2005 09:05:37 +0000 |
| Subject: | DB error | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-22054@lists.php.net to get a copy of this message | ||
I have a problem with DB error.
Here is a sample of code:
<?php
[... initialize $db with DB::connect() ]
$res =& $db->query($sql);
if (DB::isError($res)) {
exit('DB error!')
}
while ($row =& $res->fetchRow()) {
[... do something with $row ...]} ?> my problem is that sometimes the mysql server lose connection and I have a php fatal error ("Call to a member function on a non-object") on the line of fetchRow() Is there any way to avoid this? TIA -- Massimiliano Arione http://garakkio.altervista.org