I have the following sql query, how can I write the query in yii using findAll()
?
I am not using CDbCriteria
and for the time being avoiding it.
Using three tables user, category and job_profile.
SELECT *
FROM job_profile
INNER JOIN user ON user.id = job_profile.user_id
INNER JOIN category ON category.id = job_profile.category_id
WHERE category_id = 1
AND experience = 2
AND key_skills LIKE '%php%'
I have written the following queries but I do not know how to include join:
$results = SearchEmployee::model()->findAll("category_id=:category AND key_skills like
:skill AND experience=:experience", array(
'category'=>$category,
'skill'=>'%'.$skills.'%',
'experience'=>$experience
));