Searching within two columns using the standard search model method

I have 2 columns namely name and surname that are concatenated in a column in the CGridView. Now Yii comes standard with an type on inline searching, at the top of each column. Now the name column which contains "concatenated name and surname and two seperate columns in database"

If user types in a word in the name column search i want it to search within the name and surname db column and tread these columns as one value.

Now in the search method I’m not sure how to accomplish this




be converted to something like

name LIKE '%".$this->name."%' OR surname LIKE '%".$this->name."%'

using $criteria->compare

Any help will be highly appreciated

Simpy do

$criteria->addcondition("(name LIKE '%".$this->name."%' OR surname LIKE '%".$this->name."%')");

There is the possibility of do


$criteria->compare('surname',$this->name,true, 'OR');

But this solution will not add the brakets, and the surname will be in or with all other conditions.