From: bryan at bdrew dot co dot uk Operating system: Linux (Fedora5) PHP version: 5.1.4 PHP Bug Type: PDO related Bug description: PDO fails to pass Boolean paramatersl
Description: ------------ Using PDO to write boolean variables to a database table via bindValue() does not work. The attached code fails to insert either of the two rows. No errors are generated, the code just doesn't work. Its as if NULL is being passed through to the query. Substituting the booleans values for the integers 1 and 0 does work. Database MySQL 5.1 using the InnoDB engine. Reproduce code: --------------- $query = 'insert into TestDb set MyBoolean=?'; $statement = $DbConnection->prepare( $query); $statement->bindValue( 1, true, PDO::PARAM_BOOL); $statement->execute(); $statement->bindValue( 1, false, PDO::PARAM_BOOL); $statement->execute(); Expected result: ---------------- Two rows added to the table TestDb. Row 1 with MyBoolean set to TRUE Row 2 with MyBoolean set to FALSE Actual result: -------------- Nothing is inserted into the database and no errors are reported. -- Edit bug report at http://bugs.php.net/?id=38386&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38386&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38386&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38386&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38386&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38386&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38386&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=38386&r=needscript Try newer version: http://bugs.php.net/fix.php?id=38386&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38386&r=support Expected behavior: http://bugs.php.net/fix.php?id=38386&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38386&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38386&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38386&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38386&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38386&r=dst IIS Stability: http://bugs.php.net/fix.php?id=38386&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38386&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38386&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38386&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=38386&r=mysqlcfg