php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #25920 mssql_connect bad behaviour
Submitted: 2003-10-20 06:51 UTC Modified: 2015-06-08 22:09 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: morphy at 6deex dot net Assigned: cmb (profile)
Status: Closed Package: MSSQL related
PHP Version: * OS: win2k svr
Private report: No CVE-ID: None
 [2003-10-20 06:51 UTC] morphy at 6deex dot net
Description:
------------
mssql_connect use the same connection id with the same parameters but if i
need different connections to the same machine with the same user but for
different database... im f**ked..

es:



after the second call the $a connection has lost its selected db



Reproduce code:
---------------
<?php
$a = mssql_connect(HOST,USER,PASS);
mssql_select_db(DB1,$a);

$b = mssql_connect(HOST,USER,PASS);
mssql_select_db(DB2,$b);
//after the second call the $a connection has lost 
//its selected db
?>

Expected result:
----------------
i expect that $a uses DB1 and $b uses DB2 even if both dbs are in the sama host

Actual result:
--------------
the $a connection loose its own selected db

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-18 23:40 UTC] jani@php.net
-Package: Feature/Change Request +Package: MSSQL related -PHP Version: Irrelevant +PHP Version: *
 [2015-06-08 22:09 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2015-06-08 22:09 UTC] cmb@php.net
Doesn't the $link_identifier parameter for mssql_query() and
other functions solve the issue?

Anyhow, the Mssql extension has been abandoned as of PHP 5.3.0 in
favor of the SQLSRV extension.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 22:01:28 2024 UTC