php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9798 Non-select statements always return false
Submitted: 2001-03-16 17:00 UTC Modified: 2001-03-16 17:18 UTC
From: jhurshman at rocketmail dot com Assigned:
Status: Closed Package: MSSQL related
PHP Version: 4.0.4pl1 OS: Win NT 4.0
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: jhurshman at rocketmail dot com
New email:
PHP Version: OS:

 

 [2001-03-16 17:00 UTC] jhurshman at rocketmail dot com
<?php
$db = mssql_connect("host", "user", "password");

$query = 'UPDATE table_name SET field_name = "text"';
$result = mssql_query($query);
echo ($result) ? "yes" : "no";
?>

The output is "no", even though the update has actually occurred. This did not happen with 4.0.3pl1. It began happening when I upgraded to 4.0.4pl1.

I used the "(CGI binary plus server API versions for Apache, AOLserver, ISAPI and NSAPI. MySQL support built-in, many extensions included, packaged as zip)" Win32 binary.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-16 17:03 UTC] jhurshman at rocketmail dot com
Select statement do return true if they succeed. The output of this script is "yesno":

<?php
$db = mssql_connect("host", "user", "password");

$query = 'SELECT * FROM table_name';
$result = mssql_query($query);
echo ($result) ? "yes" : "no";

$query = 'UPDATE table_name SET field_name = "text"';
$result = mssql_query($query);
echo ($result) ? "yes" : "no";
?>
 [2001-03-16 17:08 UTC] jhurshman at rocketmail dot com
Sorry, I see this is the same as bug #8402.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 13 17:01:30 2024 UTC