#41876 [Asn->Fbk]: bindParam() and bindValue() do not work with MySQL MATCH () AGAINST ()
| From: | iliaa@php.net | Date: | Tue, 03 Jul 2007 23:47:29 +0000 |
| Subject: | #41876 [Asn->Fbk]: bindParam() and bindValue() do not work with MySQL MATCH () AGAINST () | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-114638@lists.php.net to get a copy of this message | ||
ID: 41876
Updated by: iliaa@php.net
Reported By: jay at mysql dot com
-Status: Assigned
+Status: Feedback
Bug Type: PDO related
Operating System: Linux 2.6.20
PHP Version: 5.2.3
Assigned To: iliaa
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
Seems to work fine in latest CVS
Previous Comments:
------------------------------------------------------------------------
[2007-07-02 20:02:37] jay at mysql dot com
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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41876&edit=1