Zend Framework

A db WHERE with a ? and a ' in it, raise an exception

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 1.7.4
  • Fix Version/s: None
  • Component/s: Zend_Db
  • Labels:
    None

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.

Issue Links

Activity

Hide
Claudio Cicali added a comment -

The Project model is simply something like that

Class Project extends Zend_Db_Table_Abstract {

}

Show
Claudio Cicali added a comment - The Project model is simply something like that Class Project extends Zend_Db_Table_Abstract { }
Hide
Claudio Cicali added a comment -

Mysql version is 5.0.67

Show
Claudio Cicali added a comment - Mysql version is 5.0.67
Hide
Satoru Yoshida added a comment -

It duplicates ZF-1343

Show
Satoru Yoshida added a comment - It duplicates ZF-1343

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: