php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31219 mssql_query() returns false on successful database insert or update
Submitted: 2004-12-21 05:09 UTC Modified: 2004-12-21 08:42 UTC
From: randy at rcs-comp dot com Assigned:
Status: Closed Package: MSSQL related
PHP Version: 5.0.3 OS: Windows XP
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: randy at rcs-comp dot com
New email:
PHP Version: OS:

 

 [2004-12-21 05:09 UTC] randy at rcs-comp dot com
Description:
------------
Upon a successful database modification, mssql_query should return true.  However, in 5.0.3, it returns false.

I went back to 5.0.2 and the bug was not present.

Possibly related to: http://bugs.php.net/bug.php?id=31135

Also possibly the same problem as this: http://bugs.php.net/bug.php?id=31195&edit=2

Although I still posted the bug because the above bug is in a different PHP version.

Reproduce code:
---------------
$link = mssql_connect('<<SERVER>>', "<<LOGIN>>", "");
   mssql_select_db("<<DB_NAME>>", $link);
   $SQL = "INSERT INTO <<TABLE_NAME>> VALUES <<VALUES>>";
   $rs = mssql_query($SQL, $link);
   if (!$rs) {
            echo "problem";
   } else {
            echo "worked";
   }

Expected result:
----------------
The DB should be updated and "worked" should be displayed

Actual result:
--------------
The DB is updated and "problem" is displayed

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-21 08:42 UTC] derick@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Nov 06 02:01:30 2024 UTC