Hey everybody. I am fairly new to Yii and have a many:many CGridview where I am trying to filter based on ANY of the related table’s record’s NAME match the user selected filter value.
public function search()
{...
$criteria->addSearchCondition('SELECT COUNT(*) FROM birdshabitat join habitat where birdshabitat.birdid =
t.birdid and habitat.habitatid = birdshabitat.habitatid and habitat.habitat = "Fields")
>0' ,'habitat',false, 'OR');
CDbException from this yii-created select:
SELECT COUNT() FROM birds
t
WHERE SELECT COUNT() FROM birdshabitat join habitat where birdshabitat.birdid = t.birdid and habitat.habitatid = birdshabitat.habitatid and habitat.habitat = "Fields") > 0 LIKE :ycp0
Can anybody tell me how to get rid of the "> 0 LIKE :ycp0" above? I have been working with this for 2 days now, so Thanks in advance for your help.
Andy