|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-05-08 09:19 UTC] maxwer at ukr dot net
Description: ------------ ibase_execute return values http://ua2.php.net/manual/ru/function.ibase-execute.php ?????????: In PHP 5.0.0 and up, this function returns the number of rows affected by the query (if > 0 and applicable to the statement type). A query that succeeded, but did not affect any rows (e.g. an UPDATE of a non-existent record) will return TRUE. if(Affected_rows == 0){ return STRING "0 " (zero and space) THIS ERROR! need BOOLEAN true }else{ return INTEGER n --- this normal } PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 07:00:01 2025 UTC |
echo "<PRE>"; $b = ibase_connect('127.0.0.1:employee','SYSDBA',SYSDBA_PASS); $t = ibase_trans(IBASE_WRITE); // update 0 rows $p = ibase_prepare($b,'update rdb$database set RDB$DESCRIPTION = null where RDB$DESCRIPTION = \'false_condition\''); $r = ibase_execute($p); ibase_rollback($t); var_dump($r); // string(2) "0 ","0 " ? but need bool(true)Could you please try with this patch against PHP_5_3 svn: Index: ibase_query.c =================================================================== --- ibase_query.c (revision 284410) +++ ibase_query.c (working copy) @@ -1031,8 +1031,7 @@ if (affected_rows) { RETVAL_LONG(affected_rows); } else { - /* this return value evaluates to bool(true) and to int(0) */ - RETVAL_STRINGL("0 ",2,1); + RETVAL_TRUE; } break; }