DB error checking, returns error when query works?
| From: | Keith Pettit | Date: | Wed, 01 Oct 2003 21:27:52 +0000 |
| Subject: | DB error checking, returns error when query works? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-8204@lists.php.net to get a copy of this message | ||
This is my first time using pear DB and it seems to be working. I'm doing some update statements which work, but the error checking is still showing errors.
Here is what I'm doing...
$query = "UPDATE test set ......";
$result = $dbh->query($query);
if(!DB::isError($result)) {
print "ERROR: $result \n";} else {
print "It worked!";} When I print the results I get "1". Origionally I had if (!DB::isError($rows = $result->numRows())) {
print "$rows\n";} else {
print "It worked!";} but I kept getting that numRows was a undefined function. And couldn't seem to get it to work. Anyways any help would be apprecaited. I would love to find some good error checking examples if they are out there. THanks, Keith