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
 [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-2019 The PHP Group
All rights reserved.
Last updated: Thu Nov 14 21:01:41 2019 UTC