I am implementing a simpleQuery action in Yii to findAll records that match at least one of several CDbCriteria or if necessary, just some search conditions. For example, I want the user to be able to query my records by typing in one string. That string should be checked against each of four columns, and the result set should include all records that have at least one column matched against the string (with no duplicates). I’m still new to Yii so any help is greatly appreciated.
I am implementing a simpleQuery action in Yii to findAll records that match at
Share
Assuming that you have the search input in $search_input field of the model and you want to search all of the three fields – name, title and desc, for that string, you can do –