ZF-5790: A db WHERE with a ? and a ' in it, raise an exception
Description
This is the minimal test case:
$model = new Project();
$q = "test?'";
$rs = $model->fetchAll($model->select()->where('name=?',$q));
Raises "SQLSTATE[HY093]: Invalid parameter number: no parameters were bound"
Note that $q contains a ? AND a ' (single quote)
With a single "?" or a single "'" it works as expected.
Using PDO_MYSQL adapter PHP 5.2.6 (Ubuntu)
php_value magic_quotes_gpc "0" php_value magic_quotes_runtime "0" php_value magic_quotes_sybase "0"
UPDATE: with the MYSQLI adapter it works.
Comments
Posted by Claudio Cicali (claudio) on 2009-02-15T08:21:20.000+0000
The Project model is simply something like that
Class Project extends Zend_Db_Table_Abstract {
}
Posted by Claudio Cicali (claudio) on 2009-02-15T08:24:30.000+0000
Mysql version is 5.0.67
Posted by old of Satoru Yoshida (yoshida@zend.co.jp) on 2009-05-16T19:01:56.000+0000
It duplicates ZF-1343