#24206 [Fbk]: PEAR::DB does not work properly with multiple databases

From: Date: Tue, 17 Jun 2003 11:32:01 +0000
Subject: #24206 [Fbk]: PEAR::DB does not work properly with multiple databases
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-17533@lists.php.net to get a copy of this message
ID: 24206 Updated by: arnaud@php.net Reported By: fretnoiz at yandex dot ru Status: Feedback Bug Type: PEAR related Operating System: Windows 2000 PHP Version: 4.3.2 New Comment: BTW, not sure about that but try removing the reference PEAR::setErrorHandling(PEAR_ERROR_DIE); $result2 = $cisDB->query("SELECT NAME FROM kod WHERE NAME='$code'"); print_r($result2->fetchRow()); echo "<br>\n"; } Previous Comments: ------------------------------------------------------------------------ [2003-06-17 06:28:58] arnaud@php.net So, if you do a PEAR::setErrorHandling(PEAR_ERROR_DIE); What does it give ? alternatively you can try the following $result2 =& $cisDB->query("SELECT NAME FROM kod WHERE NAME='$code'"); if (DB::isError($result2)) { die($result2->getErrorMessage() . ' ' . $result2->getUserinfo()); } ------------------------------------------------------------------------ [2003-06-17 05:59:02] fretnoiz at yandex dot ru Yes, I've tried but error handler was not called and the result remained the same. Additionally, I've reproduced the same result in Linux environment. ------------------------------------------------------------------------ [2003-06-17 03:27:37] arnaud@php.net Have you tried the code provided by Tomas ? Additionnally you can die on the error function pe($obj) { die($obj->toString()); } PEAR::setErrorHandler(PEAR_ERROR_CALLBACK, 'pe'); ------------------------------------------------------------------------ [2003-06-16 15:23:12] fretnoiz at yandex dot ru SORRY!! I've submitted the result which I didn't want to reproduce Actual result is following -------------------------- 006.905 Warning: ibase_fetch_row(): supplied argument is not a valid InterBase result resource in d:\php4\pear\DB\ibase.php on line 214 ------------------------------------------------------------------------ [2003-06-16 12:45:01] cox@php.net $result2 =& $cisDB->query("SELECT NAME FROM kod WHERE NAME='$code'"); print_r($result2->fetchRow()); "Fatal error: Call to undefined function: fetchrow() in c:\Web\htdocs\test_pear.php on line 23" The problem seems that you are not checking for errors. At the top of your code put the following lines: function pe($obj) { echo $obj->toString(); } PEAR::setErrorHandler(PEAR_ERROR_CALLBACK, 'pe'); and try again. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/24206 -- Edit this bug report at http://bugs.php.net/?id=24206&edit=1

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