php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45756 Query is executed on wrong server (resource). Bug with global resource scope?
Submitted: 2008-08-08 07:18 UTC Modified: 2008-08-20 01:00 UTC
From: jochem dot blok at fasterforward dot nl Assigned:
Status: No Feedback Package: MSSQL related
PHP Version: 5.2.6 OS: Debian
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
21 + 20 = ?
Subscribe to this entry?

 
 [2008-08-08 07:18 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-08 07:20 UTC] 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-20 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 06:01:29 2024 UTC