I am very sorry for that kind of easy question but i cannot find any matching issue to my simple question.
I am using the following code in my controller and i would like to add a condition like my keyword to search
within the column called ‘url’ … i need a generated query like
select * from redirects where url =’%test%’;
Thanks for your replies.
$keyword = 'test'; $criteria=new CDbCriteria(); $criteria->order = 'url asc'; $count=Redirects::model()->count($criteria); $pages=new CPagination($count); // results per page $pages->pageSize=100; $pages->applyLimit($criteria); $models=Redirects::model()->findAll($criteria); $this->render('listing', array('redirects' => $models,'pages' => $pages ));