Probably a similar topic on the web, but it was a difficult search. I got thousand of results, but none with the exact problem i have.
So im working in Yii, and i need a query to give me the following.
One column must be equal to $firsvariable and another column must be equal to $seconvariable OR $thirdvariable. The second column has only 3 options in a enum.
Now, i've tried several different approches, and tried to read up on CDbCriteria Class reference, but no luck so far.
Ive tried
$criteria=new CDbCriteria;
$criteria->condition = "column1=".$firstvariable;
$criteria->addCondition('column2!= 2', 'AND');
and
$criteria=new CDbCriteria;
$criteria->condition = "column1=".$firstvariable;
$criteria->addCondition('(column2 = 0 OR column2 = 1)', 'AND');
And several more.