|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56741 prepared statements with multiple vars and single binding weirdness
Submitted: 2005-12-22 00:35 UTC Modified: 2005-12-28 17:05 UTC
From: xing at mac dot com Assigned:
Status: Not a bug Package: PDO_MYSQL (PECL)
PHP Version: 5_1 CVS-2005-12-22 OS: CENTOS 4.2
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: xing at mac dot com
New email:
PHP Version: OS:


 [2005-12-22 00:35 UTC] xing at mac dot com
Using php 5.1CVS checked out around 19th 2005 and pdo + pdo_mysql packaged in that cvs checkout.

Reproduce code:
use mysql_pdo:

$st = $db->prepare("select * from test where c = 2 AND (a = :a OR b = :a)");

$st->execute(array(":a" => 2));

Expected result:
Rows matching where a == 2 or b == 2. 

Actual result:
0 row result regardless of what's in the database. No error or exceptions from pdo.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-22 00:38 UTC] xing at mac dot com
mysql server: 4.1.16
 [2005-12-28 17:05 UTC] xing at mac dot com
it was an error on my part. Setting the error PDO attribute in the pdo _construct method rather than using the setAttribute() after pdo construction. Setting the error atribute in PDO construct has no effect.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Mar 23 06:03:38 2023 UTC