#39483 [Opn->Fbk]: Problem with using placeholders and string constants in PDO MySQL

From: Date: Sun, 12 Nov 2006 17:56:36 +0000
Subject: #39483 [Opn->Fbk]: Problem with using placeholders and string constants in PDO MySQL
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-104851@lists.php.net to get a copy of this message
ID: 39483 Updated by: iliaa@php.net Reported By: suhachov at gmail dot com -Status: Open +Status: Feedback Bug Type: PDO related Operating System: Linux PHP Version: 5.2.0 New Comment: which version of MySQL are you using? Previous Comments: ------------------------------------------------------------------------ [2006-11-12 16:23:41] suhachov at gmail dot com Description: ------------ It seems that PDO sql parser is broken and tries to look for placeholders within string constants. $dbh = new PDO('mysql:...','...','...'); $sth = $dbh->prepare('SELECT my_udf(\'\0:D\0\'),?'); $sth->execute(array(1)); This code triggers an error: PDO::prepare(): SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters And I can't replace string constant with placeholder, because MySQL doesn't allows to use placeholders with UDFs. Reproduce code: --------------- see above. You even don't need any installed UDF. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39483&edit=1

« previous php.bugs (#104851) next »