Raise error in case of wrong query
| From: | akorthaus at web dot de | Date: | Tue, 13 May 2003 17:53:37 +0000 |
| Subject: | Raise error in case of wrong query | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-5354@lists.php.net to get a copy of this message | ||
Hi!
If I try this:
$result = $db->query($sql);
while ($row = $result->fetchRow()) {
....
}
This only works if I have no errors in my query.
But if I put in this
$result = $db->query($sql);
if (DB::isError($db)) {
die ($db->getMessage());
}
while ($row = $result->fetchRow()) {
....
}
nothing changes, I get a PHP-Error : Fatal error: Call to undefined
function: fetchrow()
Is there a possibility to raise a PEAR Error if there is a problem with
fetchRow?
Tank You
Andreas