Req #7760 [Opn]: new_link option is not in the documentation
| From: | str at strgt dot cjb dot net | Date: | Tue, 30 May 2006 21:22:58 +0000 |
| Subject: | Req #7760 [Opn]: new_link option is not in the documentation | ||
| References: | 1 | Groups: | php.pear.doc |
| Request: | Send a blank email to pear-doc+get-7959@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=7760&edit=1
ID: 7760
User updated by: str at strgt dot cjb dot net
Reported By: str at strgt dot cjb dot net
Status: Open
Id: 7760
Type: Feature/Change Request
Package: Documentation
Operating System: GNU/Linux
PHP Version: 5.1.2
New Comment:
This is working well, but it is not in the documentation
Previous Comments:
------------------------------------------------------------------------
[2006-05-30 17:22:00] str at strgt dot cjb dot net
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 this bug report at http://pear.php.net/bugs/bug.php?id=7760&edit=1