#36923 [NEW]: PDO::query fails when query contains special charactes
| From: | farin at refresh dot cz | Date: | Thu, 30 Mar 2006 11:27:40 +0000 |
| Subject: | #36923 [NEW]: PDO::query fails when query contains special charactes | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-95114@lists.php.net to get a copy of this message | ||
From: farin at refresh dot cz
Operating system: Gentoo
PHP version: 5.1.2
PHP Bug Type: PDO related
Bug description: PDO::query fails when query contains special charactes
Description:
------------
When $query parameter for PDO::query contains
' :A and ? (as part of data) query fails with error
Invalid parameter number: mixed named and positional parameters. This
behavior is appear with PDO mysql driver. In PHP 5.1.1 is not this bug
present.
Reproduce code:
---------------
$pdo->query("insert into foo (bar) values ('\\ ? :A')");
Expected result:
----------------
SQL syntax is Ok so query should be proccessed without error.
Actual result:
--------------
Warning: PDO::query() [function.query]: SQLSTATE[HY093]: Invalid parameter
number: mixed named and positional parameters in ...
And query fails.
--
Edit bug report at http://bugs.php.net/?id=36923&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36923&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36923&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36923&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36923&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=36923&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36923&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36923&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36923&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36923&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36923&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=36923&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=36923&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36923&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36923&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36923&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36923&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36923&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36923&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36923&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36923&r=mysqlcfg