I’m having a problem with the condition of cdbCriteria.
It doesn’t seem to work. In the condition, I state that “country_id=2”, but the results that I print out does not show country_id=2. Instead, the results show a combination of various country_id (those that equals to 2 as well as those not equals to 2).
My code is as below. Is there anything wrong?
Controller codes:
$criteria->select = 't.*, user.*, country.*';
$criteria->join = ' INNER JOIN user ON t.user_id = user.id INNER JOIN country ON t.country_id = country.country_id';
$criteria->condition = 't.country_id=2'; //this does not work. It does not return results whereby country_id=2
$dataProvider=new CActiveDataProvider("Project", array('criteria'=>$criteria));