ID: 28433 User updated by: r dot vanicek at seznam dot cz Reported By: r dot vanicek at seznam dot cz Status: Open Bug Type: Sybase (dblib) related Operating System: Debian GNU/Linux PHP Version: 4.3.6 New Comment:
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. Previous Comments: ------------------------------------------------------------------------ [2004-05-18 15:28:42] r dot vanicek at seznam dot cz Description: ------------ 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"); var_dump($ret); Expected result: ---------------- false Actual result: -------------- 1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28433&edit=1