Re: Bug #17305: Handle multiple connection in SQL Server
| From: | Tomas V.V.Cox | Date: | Mon, 20 May 2002 12:14:10 +0000 |
| Subject: | Re: Bug #17305: Handle multiple connection in SQL Server | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-6231@lists.php.net to get a copy of this message | ||
Hi,
Could you try this version if works as expected?
Thanks,
Tomas V.V.Cox
vania@fe.up.pt wrote:
>
> From: vania@fe.up.pt
> Operating system: Win 2000
> PHP version: 4.2.0
> PHP Bug Type: PEAR related
> Bug description: Handle multiple connection in SQL Server
>
> It seems that DB.php cannot handle different connections for SQL Server. I
> noticed that you fixed this for MySQL.
>
> In mysql.php you have this:
> if ($dsninfo['database']) {
> // fix to allow calls to different databases in
> the same script
> if (empty($GLOBALS['_DB_mysql_changed_database'])) {
> $this->_changed_db = false;
> if (!@mysql_select_db($dsninfo['database'], $conn)) {
> return $this->raiseError(DB_ERROR_NODBSELECTED, null,
> null, null, mysql_error($conn));
> }
> } else {
> $GLOBALS['_DB_mysql_changed_database'] = true;
> $this->_changed_db = $dsninfo['database'];
> }
> }
>
> And in mssql.php it's only this:
>
> if ($dsninfo['database']) {
> if (!@mssql_select_db($dsninfo['database'], $conn)) {
> return $this->raiseError(DB_ERROR_NODBSELECTED, null,
> null, null, mssql_get_last_message());
> }
> }
>
> In my scripts I noticed that it handles only the last connection made and
> ignores queries with the other objects created to access database.