Zend select 中的“SELECT”语句有问题。
public function listAnswers($sort_field = 'answer_id', $field = null, $value = null, $strict_filter = false, $client_id = null) {
//here is $value
// $value = "abcd : <?\\?>";
$value = $this->getDefaultAdapter()->quote("%".$value."%");
if( !empty($field) && !empty($value) && $strict_filter == false){
$select = $this->select()->where(" client_id != -99 ")->where($field . " like $value ")->order($sort_field);
}
}
错误来了,我打印的查询是
SELECT `answer`.* FROM `answer` WHERE ( client_id != -99 ) AND (client_id = '1') AND (answer_text LIKE '%abcd : <?\\\\?>%' ) ORDER BY `add_date` DESC
记录不来就酌情$value
了。