Re: DB error checking, returns error when query works?

From: Date: Thu, 02 Oct 2003 08:09:17 +0000
Subject: Re: DB error checking, returns error when query works?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8222@lists.php.net to get a copy of this message
On Wed, 1 Oct 2003, Keith Pettit wrote: > This is the code I'm using: > > $result = $dbh->query($query); > if(!DB::isError($result)) { > die($result->getMessage()); > } else { > print "It worked!"; > } > $dbh->disconnect(); You have reverse logic in here: if(!DB::isError($result)) == if NOT an error it should be if(DB::isError($result)) if IS error -- Mika Tuupola http://www.appelsiini.net/~tuupola/

« previous php.pear.general (#8222) next »