#45756 [Opn->Fbk]: Query is executed on wrong server (resource). Bug with global resource scope?

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
 ID:               45756
 Updated by:       [email protected]
 Reported By:      jochem dot blok at fasterforward dot nl
-Status:           Open
+Status:           Feedback
 Bug Type:         MSSQL related
 Operating System: Debian
 PHP Version:      5.2.6
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi




Previous Comments:
------------------------------------------------------------------------

[2008-08-08 07:20:10] jochem dot blok at fasterforward dot nl

Btw. FreeTDS is used described in the manual:
http://nl2.php.net/manual/en/mssql.setup.php

------------------------------------------------------------------------

[2008-08-08 07:18:08] jochem dot blok at fasterforward dot nl

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 this bug report at http://bugs.php.net/?id=45756&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.