Bug #67799 [NEW]: mssql_close($link) doesn't seem to close the $link
| From: | maferra at isq dot pt | Date: | Wed, 06 Aug 2014 16:23:57 +0000 |
| Subject: | Bug #67799 [NEW]: mssql_close($link) doesn't seem to close the $link | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187004@lists.php.net to get a copy of this message | ||
From: maferra at isq dot pt
Operating system: SunOS 5.11 11.1 i86pc
PHP version: Irrelevant
Package: MSSQL related
Bug Type: Bug
Bug description:mssql_close($link) doesn't seem to close the $link
Description:
------------
I'm using PHP 5.3.14, but I believe that the mssql extension has not
been updated for a while.
Description: mssql_close($link) doesn't seem to close the $link (and
perhaps NULL the $link variable), but mssql_close() does close the last
opened link. In the test script I have made an example.
Test script:
---------------
MSSQL_SERVERNAME, MSSQL_USERNAME, MSSQL_PASSWORD are constants with the
real parameters.
Example (it works):
===================
Code:
var_dump(mssql_connect(MSSQL_SERVERNAME, MSSQL_USERNAME,
MSSQL_PASSWORD));
var_dump(mssql_close());
$f = mssql_fetch_assoc(mssql_query("select getdate();"));
var_dump($f);
Output:
resource(2) of type (mssql link)
bool(true)
NULL
Example (it doesn't work as expected):
======================================
Code:
var_dump($c = mssql_connect(MSSQL_SERVERNAME, MSSQL_USERNAME,
MSSQL_PASSWORD));
var_dump(mssql_close($c));
$f = mssql_fetch_assoc(mssql_query("select getdate();", $c));
var_dump($f);
Output:
resource(2) of type (mssql link)
bool(true)
array(1) {
'computed' =>
string(26) "Aug 6 2014 05:18:37:883PM"
}
I believe that it shouldn't have made the query (in fact,
mssql_close($c) has returned true, so the link should be closed).
Can I give you further further information?
Best regards,
--
Edit bug report at https://bugs.php.net/bug.php?id=67799&edit=1
--