|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28433 sybase_query always returns 1 on non-select queries
Submitted: 2004-05-18 15:28 UTC Modified: 2004-05-18 16:23 UTC
From: r dot vanicek at seznam dot cz Assigned:
Status: Not a bug Package: Sybase (dblib) related
PHP Version: 4.3.6 OS: Debian GNU/Linux
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: r dot vanicek at seznam dot cz
New email:
PHP Version: OS:


 [2004-05-18 15:28 UTC] r dot vanicek at seznam dot cz
sybase_query call should return false when the query fails. This is true if the query is a "select..." command. But for the other commands (eg. insert), sybase_query always return 1 no matter if the command is OK or not. This makes testing the query success/failure nearly impossible.

Reproduce code:
$ret = sybase_query("insert");

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-18 15:42 UTC] r dot vanicek at seznam dot cz
Sorry, this is probably not a bug of php_sybase client. If there is a syntax error in the query, sybase reports "Error" and sybase_query returns FALSE as expected.

But is there is eg. NULL value specified for a NOT NULL column, sybase reports "Warning" and sybase_query returns 1 (OK).

The other SQL servers take this as error, and rightly so (I think), because operation is not completed and no row is entered in the table, sigh.
 [2004-05-18 16:23 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

The return value returned by sybase does not indicate an 
error, which is why PHP does not return false. 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 18 04:01:32 2024 UTC