I'm a yii programmer...
I have 2 variables and I want to check if the first variable exists in the the city column and the second variable in type "OR" category column.
I did this and it doesn't work :
$criteria = new CDbCriteria(array(
'condition'=>'published="true"'
));
if(isset($_GET['city']) || isset($_GET['word']))
{
if(!empty($_GET['city']) )
$criteria->addSearchCondition('city',$_GET['city'] , true, 'AND');
if(!empty($_GET['word']) ){
$criteria->addSearchCondition('type',$_GET['word'] , true, 'OR');
$criteria->addSearchCondition('category',$_GET['word'] , true, 'OR');
}
}
And only rows with published=true will be displayed...
As a result i get rows that doesn't meet my criteria..
Where is the problem please help thanks