php - How to write the query in yii,using findAll() -
I have the following SQL query, how can I write in yii using I am not using User, category and job_profile using three tables. Enter the category at the INNER user.id = job_profile.USR_ID INNER on the INNER user from SELECT * job_profile category.id = job_profile.category_id where range_ id = 1 and experience = 2 and key_skills'% php% I have written the following questions, but I am not sure about joining: You can find the names of relationships in your JobProfile model Example for relationships Your JobProfile model file will have source code such as < p> In your controller example findAll ()
CDbCriteria and to avoid that time.
$ results = SearchEmployee :: Models () - & gt; FindAll (like "category_id =: Category and key_skills: skills and experience =: experience", array ('category' => gt; $ category, 'skill' = & gt; '%'. $ skill. '%', 'Experience' = & gt; $ experience);
$ Models = JobProfile :: model () - & gt; With ('userrelationname', 'categoryrelationname') - & gt; findAll (like array ("condition" => "TC category_ID = 1 and T. experience = 2 and T. key_skillik '% php%'"));
public function relation () {return array ('user' => array (auto :: BELONGS_TO, 'user', 'id'),)}
foreach ($ m $$ model) {echo $ m ['user' Id']; // Revert to your job_profile table $ m-> user- & gt; Id; // in your user table)
php स्क्रिप्टिंग नमूना कोड
ReplyDeleteउपयोगकर्ताओं को आईपी पता कोड नमूना प्राप्त करें