Re: PEAR::setErrorHandling conflicts with nextId() ?

From: Date: Thu, 30 Aug 2001 15:31:26 +0000
Subject: Re: PEAR::setErrorHandling conflicts with nextId() ?
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-1724@lists.php.net to get a copy of this message
On Thursday 30 August 2001 16:01, Piotr Roszatycki wrote: > PHP/4.0.6 > PEAR/CVS snapshot > > I've found $dbh->nextId() breaks setErrorHandling(). > This script should print error, but it doesn't. > > <?php > > PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, "db_error_handler"); > > $db = new DB; > $dbh = @$db->connect($dsn); You could do simply: $db = DB::connect($dsn); > $id = $dbh->nextId("service"); There were a bug here. It's corrected now in the last CVS version of PEAR.php. Please try again with it. > > $dbh->simpleQuery("SYNTAX ERROR"); The correct sintax is: $dbh->query(..), don't use simpleQuery (will break queries that returns a result). Tomas V.V.Cox

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