public function search_between() {
$min = $this->request->query['min'];
$max = $this->request->query['max'];
$conditions = array('Ad.price BETWEEN ? AND ?' => array($min,$max));
$ads = $this->Anuncio->find('all',array('conditions' => $conditions));
$this->set('ads',$ads);
}
警告:strlen()期望参数1是字符串,数组给定。CakePHP 2.8为什么我的search_between函数给我一个警告?
**Thank's for your help I'm new to asking questions here.**
你能张贴你在哪里调用'strlen的()' ? – bill
我不调用strlen()它的一个警告显示cakephp当我将数组中的变量($ min,$ max)传递给Between:array('Ad.price BETWEEN?AND?'=> array( $ min,$ max)< - 这些数组会导致警告,但我不知道为什么。谢谢 –
你可以尝试抛出你的请求生成的sql吗?这是一个很好的方法来开始调试这个 – Amjo