|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-07-03 23:47 UTC] iliaa@php.net
[2007-07-11 01:00 UTC] php-bugs at lists dot php dot net
[2008-07-23 10:27 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 06:00:01 2025 UTC |
Description: ------------ When using the MATCHES(cols...) AGAINST (phrase) construct in MySQL using PDO prepared statements and bound parameters, the binding does not recognize the "?" within the AGAINST (). Reproduce code: --------------- $pdo= new PDO("mysql:host=localhost;dbname=some_db","some_user","some_pass"); $sql= "SELECT * FROM some_table WHERE MATCH(some_col) AGAINST (?)"; $statement= $pdo->prepare($sql); $statement->bindValue(1, "some search phrase"); $statement->execute(); // Will error here with "invalid parameter number, no parameters bound" If you replace the ? in the SQL statement with the string search phrase value, it will work fine. Expected result: ---------------- Expect to bind the value into the unnamed parameter and execute properly. Actual result: -------------- Warning: PDOStatement::execute() [function.PDOStatement-execute]: SQLSTATE[HY093]: Invalid parameter number: no parameters were bound in XXX