I am trying to get the data from database and use it in a condition in the if statement but its not working. and i can't figure out why. Please help me. The one i am trying is this and it doesn't work.
$criteria = new CDbCriteria();
$criteria->condition = '`label1`= '.$this->label1;
$model2 = Post::model()->findAll($criteria);
I am using Yii 1.6