|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41876 bindParam() and bindValue() do not work with MySQL MATCH () AGAINST ()
Submitted: 2007-07-02 20:02 UTC Modified: 2008-07-23 10:27 UTC
From: jay at mysql dot com Assigned: iliaa (profile)
Status: Closed Package: PDO related
PHP Version: 5.2.3 OS: Linux 2.6.20
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: jay at mysql dot com
New email:
PHP Version: OS:


 [2007-07-02 20:02 UTC] jay at mysql dot com
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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-03 23:47 UTC]
Please try using this CVS snapshot:
For Windows (zip):

For Windows (installer):

Seems to work fine in latest CVS
 [2007-07-11 01:00 UTC] 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".
 [2008-07-23 10:27 UTC]
Appears to be fixed by Johannes.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Nov 28 15:03:14 2021 UTC