#36923 [Opn->Fbk]: PDO::query fails when query contains special charactes

From: Date: Thu, 30 Mar 2006 11:29:56 +0000
Subject: #36923 [Opn->Fbk]: PDO::query fails when query contains special charactes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-95116@lists.php.net to get a copy of this message
ID: 36923 Updated by: tony2001@php.net Reported By: farin at refresh dot cz -Status: Open +Status: Feedback Bug Type: PDO related Operating System: Gentoo PHP Version: 5.1.2 New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [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 (#95116) next »