|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31587 return value of mssql_query changed in 4.3.10, no longer returns accurate rslt.
Submitted: 2005-01-17 21:27 UTC Modified: 2005-01-17 23:42 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: php at yvanrodrigues dot com Assigned:
Status: Closed Package: MSSQL related
PHP Version: 4.3.10 OS: Windows 2000/IIS 5.0/PHP 4.3.11
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.
Block user comment
Status: Assign to:
Bug Type:
From: php at yvanrodrigues dot com
New email:
PHP Version: OS:


 [2005-01-17 21:27 UTC] php at yvanrodrigues dot com
Previous to 4.3.10, mssql_query returned the following:
=== a valid result set OR
=== true if successful but no result set OR
=== false if an error occurred

Therefore if one wanted to check for an error one would use:
if(mssql_query === false) { echo 'yikes!'; }

Since 4.3.10, when using mssql_query to execute an INSERT query, a result of false is returned even if the row was successfully inserted.

Reproduce code:
$rs = mssql_query($query);
if($rs === false) {
   echo 'This should only print when there is an error';

Expected result:
$rs should only evaluate === false when there is an error (according to the docs)

Actual result:
$rs always evaluates === false on INSERT


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-17 22:11 UTC] php at yvanrodrigues dot com
obviously that should read:
if(mssql_query($sql) === false) { echo 'yikes!'; }
 [2005-01-17 22:57 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.
 [2005-01-17 23:42 UTC] php at yvanrodrigues dot com
I will update my unix servers. How often are the Windows binaries updated? Thanks for the quick response.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 00:01:33 2024 UTC