#36923 [Com]: PDO::query fails when query contains special charactes

From: Date: Thu, 09 Aug 2007 22:36:02 +0000
Subject: #36923 [Com]: PDO::query fails when query contains special charactes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115920@lists.php.net to get a copy of this message
ID: 36923 Comment by: apike at sfu dot ca Reported By: farin at refresh dot cz Status: No Feedback Bug Type: PDO related Operating System: Gentoo PHP Version: 5.1.2 New Comment: This is still happening for me with PHP 5.2.0. Previous Comments: ------------------------------------------------------------------------ [2006-04-07 01:00:00] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2006-03-30 13:29:53] tony2001@php.net Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip ------------------------------------------------------------------------ [2006-03-30 13:27:39] farin at refresh dot cz 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 this bug report at http://bugs.php.net/?id=36923&edit=1

« previous php.bugs (#115920) next »