php.net |  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
24 + 42 = ?
Subscribe to this entry?

 
 [2005-12-22 00:35 UTC] xing at mac dot com
Description:
------------
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 21:01:29 2024 UTC