| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2005-01-17 21:27 UTC] php at yvanrodrigues dot com
 Description:
------------
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:
---------------
$query = "INSERT INTO DOGBERT (CATBERT) VALUES ('DILBERT')";
$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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 15:00:01 2025 UTC | 
obviously that should read: if(mssql_query($sql) === false) { echo 'yikes!'; }