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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jochem dot blok at fasterforward dot nl
New email:
PHP Version: OS:

 

 [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-2022 The PHP Group
All rights reserved.
Last updated: Tue Dec 06 17:05:53 2022 UTC