#24206 [NEW]: PEAR::DB does not work properly with multiple databases
| From: | fretnoiz at yandex dot ru | Date: | Mon, 16 Jun 2003 16:43:29 +0000 |
| Subject: | #24206 [NEW]: PEAR::DB does not work properly with multiple databases | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-17520@lists.php.net to get a copy of this message | ||
From: fretnoiz at yandex dot ru
Operating system: Windows 2000
PHP version: 4.3.2
PHP Bug Type: PEAR related
Bug description: PEAR::DB does not work properly with multiple databases
Description:
------------
If I create two different objects for database access, one of them does
not work.
For example, one DB object is connected to MySQL, second is connected to
Interbase. Interbase does not return results properly.
Reproduce code:
---------------
define('DB_DSN1', 'mysql://max:max@localhost/autogarant');
define('DB_DSN2',
'ibase://SYSDBA:masterkey@localhost/C:\IB\autogarant');
$siteDB =& DB::connect(DB_DSN1);
$cisDB =& DB::connect(DB_DSN2);
$result1 =& $siteDB->query("SELECT NAME FROM kod");
if ($row = $result1->fetchRow(DB_FETCHMODE_ASSOC)) {
$code = $row['NAME'];
echo $code . "<br>\n";
$result2 =& $cisDB->query("SELECT NAME FROM kod WHERE NAME='$code'");
print_r($result2->fetchRow());
echo "<br>\n";
}
Expected result:
----------------
The tables in the DBs contain the same data so i expect to get equivalent
records.
006.905
Array ( [0] => 006.905 )
Actual result:
--------------
006.905
Fatal error: Call to undefined function: fetchrow() in
c:\Web\htdocs\test_pear.php on line 23
--
Edit bug report at http://bugs.php.net/?id=24206&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=24206&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=24206&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24206&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24206&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24206&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24206&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24206&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24206&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24206&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24206&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24206&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24206&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24206&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24206&r=gnused