Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Findall In Relational Tables With != Condition

$
0
0
Hi all......

I have two tables jobStatus and notifiactionRules, structures of tables are:

JobStatus:

id : PK
name

notifiactionRules

id : PK
status_id : FK

i want to write a condition in findAll, such that i have to get the names of all job status that are NOT IN notifiactionRules.

I tried this:

$jobstatuslist = CHtml::listData(JobStatus::model()
->findAll(array(
'condition'=>'id!=:status_id',
'params'=>array(':status_id'=>NotificationRules::model()->findAll(),'id', 'job_status_id'))
));

but i am getting error - Undefined offset: 2

can anyone pls help.......

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>