Answer the question
In order to leave comments, you need to log in
How to search for text in two bd fields?
public function searchByName(){
$criteria = new CDbCriteria;
$criteria->compare("name_ru", 'петух', true);
$criteria->compare('name_en', 'петух' ,true);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}
Answer the question
In order to leave comments, you need to log in
Maybe you need this:
$criteria->addSearchCondition('name_ru','петух');
$criteria->addSearchCondition('name_en','петух',true,'OR);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question