0
votes
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);


        }

here where cause shows Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'conditions' in 'where clause' it is cakephp-2.4.5

1
try $result = $this->paginate('User',array($cond));Garry

1 Answers

1
votes

The second parameter for paginate is $conditions therefore:

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

Here's a further example:

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

There's more information about pagination in the book.