|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-09-05 17:59 UTC] tsteiner at nerdclub dot net
[2008-09-09 14:38 UTC] om at viazenetti dot de
[2008-10-01 17:26 UTC] tsteiner at nerdclub dot net
[2008-10-10 12:18 UTC] felipe@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ If a question mark and an escaped singel quote appear in a where statement as value, the PDO method prepare tries to bind a value to the question mark. Because no values are passed, pdo throws an exception (Only tested with where statements): PDOStatement::execute() [function.PDOStatement-execute]: SQLSTATE[HY093]: Invalid parameter number: no parameters were bound in Reproduce code: --------------- <?php $db = new PDO('mysql:host=localhost;dbname=DATABASE', 'USER', 'PASSWORD'); $sth = $db->prepare("SELECT * FROM `TABLE` WHERE (login = '?\'')"); $sth->execute(); var_dump($sth->fetch()); Expected result: ---------------- Array or false Actual result: -------------- Exception: PDOStatement::execute() [function.PDOStatement-execute]: SQLSTATE[HY093]: Invalid parameter number: no parameters were bound in