From: jochem dot blok at fasterforward dot nl
Operating system: Debian
PHP version: 5.2.6
PHP Bug Type: MSSQL related
Bug description: Query is executed on wrong server (resource). Bug with global
resource scope?
Description:
------------
See reproduce code. The query is executed 2 times on resource $r2.
Reproduce code:
---------------
$r1 = mssql_connect('my_server', 'my_user', 'my_pass');
mssql_select_db('database_1', $r1);
$r2 = mssql_connect('my_server', 'my_user', 'my_pass');
mssql_select_db('database_2', $r2);
$sSql = 'select count(*) as total from my_table';
$rRes1 = mssql_query($sSql, $r1);
$oRow1 = mssql_fetch_object($rRes1);
echo '1: '.$oRow1->total.'<br>';
$rRes2 = mssql_query($sSql, $r2);
$oRow2 = mssql_fetch_object($rRes2);
echo '2: '.$oRow2->total.'<br>';
Expected result:
----------------
Different total.
Actual result:
--------------
Same total.
--
Edit bug report at http://bugs.php.net/?id=45756&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=45756&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=45756&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=45756&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45756&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=45756&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45756&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45756&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45756&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45756&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45756&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=45756&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=45756&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45756&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45756&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45756&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45756&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45756&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45756&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45756&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45756&r=mysqlcfg