Req #7760 [NEW]: new_link option is not in the documentation
| From: | str at strgt dot cjb dot net | Date: | Tue, 30 May 2006 21:22:00 +0000 |
| Subject: | Req #7760 [NEW]: new_link option is not in the documentation | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-7958@lists.php.net to get a copy of this message | ||
From: str at strgt dot cjb dot net
Operating system: GNU/Linux
Package version:
PHP version: 5.1.2
Package: Documentation
Bug Type: Feature/Change Request
Bug description: new_link option is not in the documentation
Description:
------------
When you are connecting to two databases with
the same info except database name, executing a query on the first,
executing a query on the second, and then executing a query on the
first again results in the third query using the wrong database. I
found this while trying to figure out what is going on to cause this
problem that didn't exist before I migrated from DB to MDB2.
This problem is solve using ?new_link=true in the dsn in the 2 dsn like
here:
$dsn =
"mysql://$dbUser:$dbPasswd@localhost/$database?new_link=true";
Test script:
---------------
$dbUser = "root";
$dbPasswd = "toor";
$database = "db1";
$dsn =
"mysql://$dbUser:$dbPasswd@localhost/$database?new_link=true";
$db =& MDB2::factory($dsn);
if (PEAR::isError($db)) {
die ($db->getMessage());
}
$dbUser = "root";
$dbPasswd = "toor";
$database = "db2";
$dsn =
"mysql://$dbUser:$dbPasswd@localhost/$database?new_link=true";
$stdb =& MDB2::factory($dsn);
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=7760&edit=1
--