return value of rollback() is inverted
| Bug #31710 | return value of rollback() is inverted | ||||
|---|---|---|---|---|---|
| Submitted: | 2005-01-26 23:17 UTC | Modified: | 2005-01-27 11:21 UTC | ||
| From: | cyrilleml at kbuilder dot net | Assigned: | georg (profile) | ||
| Status: | Closed | Package: | MySQLi related | ||
| PHP Version: | 5.0.3 | OS: | winXP Pro | ||
| Private report: | No | CVE-ID: | None | ||
[2005-01-26 23:17 UTC] cyrilleml at kbuilder dot net
Description:
------------
Hello,
Functions rollback() works fine expected that
the return value is inverted.
if rollback() failed, return value is TRUE,
if rollback() success, return value is FALSE.
The problem is that the Documentation say the opposite.
So for my code work fine, I've to write:
if( $dbh1->rollback() ){
printf( "DBH1 Failed to rollback : %s \n", $dbh1->error);
}
bye
cyrille
Reproduce code:
---------------
if( $dbh1->rollback() ){
printf( "DBH1 Failed to rollback : %s \n", $dbh1->error);
}
Expected result:
----------------
if( ! $dbh1->rollback() ){
printf( "DBH1 Failed to rollback : %s \n", $dbh1->error);
}
or
if( $dbh1->rollback() == FALSE ){
printf( "DBH1 Failed to rollback : %s \n", $dbh1->error);
}
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2005-01-26 23:59 UTC] tony2001@php.net
[2005-01-27 11:21 UTC] georg@php.net