From:             jay at mysql dot com
Operating system: Linux 2.6.20
PHP version:      5.2.3
PHP Bug Type:     PDO related
Bug description:  bindParam() and bindValue() do not work with MySQL MATCH () 
AGAINST ()

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 bug report at http://bugs.php.net/?id=41876&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41876&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41876&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41876&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41876&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41876&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41876&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41876&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41876&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41876&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41876&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41876&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41876&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41876&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41876&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41876&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41876&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41876&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41876&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41876&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41876&r=mysqlcfg

Reply via email to