|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39398 No cast of logic type and silence
Submitted: 2006-11-06 11:56 UTC Modified: 2006-11-07 17:57 UTC
From: develar at gmail dot com Assigned:
Status: Closed Package: PDO related
PHP Version: 5.2.0 OS: Debian 3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: develar at gmail dot com
New email:
PHP Version: OS:


 [2006-11-06 11:56 UTC] develar at gmail dot com
PDO does not cast a variable with boolean type in bindValue, does not do execute and is silent.

I should cast manually - (int).

Reproduce code:
  `test` tinyint(1) NOT NULL default '0'

$Db = new PDO('mysql:host=localhost;dbname=test', 'root', '');

$boolean = 1;
$Pdo = $Db->prepare('INSERT INTO test VALUES (:boolean)');
$Pdo->bindValue(':boolean', isset($boolean), PDO::PARAM_INT);

Expected result:
array(1) { [0]=> array(1) { ["test"]=> string(1) "1" } }

Actual result:
array(0) { }


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-06 11:59 UTC] develar at gmail dot com
var_dump($Db->query('SELECT * FROM test')->fetchAll());
 [2006-11-07 17:57 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Sep 26 00:01:25 2023 UTC