ID:               38386
 Updated by:       [EMAIL PROTECTED]
 Reported By:      bryan at bdrew dot co dot uk
-Status:           Open
+Status:           Feedback
 Bug Type:         PDO related
 Operating System: Linux (Fedora5)
 PHP Version:      5.1.4
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.




Previous Comments:
------------------------------------------------------------------------

[2006-08-08 20:10:40] bryan at bdrew dot co dot uk

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 this bug report at http://bugs.php.net/?id=38386&edit=1

Reply via email to