where子句中的列条件显示错误

时间:2014-04-30 11:44:02

标签: cakephp

public function search() {
         $this->loadmodel('Usermgmt.User');
        if ($this->request -> isPost()) {
            $this->User->set($this->data);
            $keyword=$this->data['Doctors']['search'];

    $this->paginate['limit'] = 3; 
 $result = $this->paginate('User',array('conditions'=>$cond));
  $this->set('result', $result);


        }

这里显示错误:SQLSTATE [42S22]:未找到列:1054'where子句'中的未知列'条件'是cakephp-2.4.5

1 个答案:

答案 0 :(得分:1)

paginate的第二个参数是$conditions因此:

$result = $this->paginate('User', $cond);

以下是另一个例子:

$data = $this->Paginator->paginate(
    'Recipe',
    array('Recipe.title LIKE' => 'a%')
);

more information about pagination in the book

相关问题