From: xing at mac dot com
Operating system: centos 4.2
PHP version: 5.1.2RC1
PHP Bug Type: PDO related
Bug description: prepared quries returning 0 rows with variable in multiple
places
Description:
------------
Mysql version 4.1.15
use mysql_pdo with attribute enabled to have it throw exception on all
errors:
Reproduce code:
---------------
$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 OR an exception if pdo doesn't
support having the same variable appear more than once in a prepared
query.
Actual result:
--------------
0 row result regardless of what's in the database. No error or
exceptions from pdo. Everything points to successful query when nothing
has been executed.
--
Edit bug report at http://bugs.php.net/?id=35824&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=35824&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=35824&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=35824&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35824&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=35824&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35824&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35824&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35824&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35824&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35824&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=35824&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=35824&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35824&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35824&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35824&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35824&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35824&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35824&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35824&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35824&r=mysqlcfg