Re: Big problem with DB::isError!

From: Date: Mon, 18 Aug 2003 12:20:40 +0000
Subject: Re: Big problem with DB::isError!
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-19979@lists.php.net to get a copy of this message
"Stefan Walk" <swalk@prp.physik.tu-darmstadt.de> a écrit dans le message de news:20030818121649.GB15758@prp0.prp.physik.tu-darmstadt.de... > On Mon, Aug 18, 2003 at 02:10:38PM +0200, nicos@php.net wrote: > > Hello, > > > > It looks in every part of the code we use, if(DB::isError($res). But in > > fact isError returns FALSE in case of error so we should use !DB::isError or > > just change the behaviour of isError ? Very easy to verify it with the bug > > #25003... > > > > Very urgent, need feedback ! > > #25003. > > function isError($value) > { > return (is_object($value) && > (get_class($value) == 'db_error' || > is_subclass_of($value, 'db_error'))); > } > > Read: > This function returns true if and only if > The parameter is an object AND > the object is of the class DB_Error OR > the object's class is derived from DB_Error > > Just as you would think... and it works here. Well okay but with a DELETE query if you try to fetch it, it will not work just because the query is NOT an error. In fact in that case, is_object is FALSE... so we need a better way to find out if we can try to fetch a query or not... > > > -- > Regards, > Stefan Walk > <swalk@prp.physik.tu-darmstadt.de>

« previous php.pear.dev (#19979) next »