|  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
 [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-2021 The PHP Group
All rights reserved.
Last updated: Wed Apr 14 00:01:24 2021 UTC