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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: xing at mac dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 04:01:27 2025 UTC