query with 2 conditions

I have a table and I want to pass a query with 2 parameters.

I write this



                 'params'=>array(':bk_id'=>$key->bk_id,':lan_code'=>$plan->lan_code) )); 

but it does not work, what is wrong?


this maybe work for you


            'condition'=>array('bk_id=:bk_id AND lan_code=:lan_code'),

             'params'=>array(':bk_id'=>$key->bk_id,':lan_code'=>$plan->lan_code) ));

I don’t think that this works in Yii - unfortunatly :(

You just have to write it like this:

‘condition’=>‘bk_id=:bk_id AND lan_code=:lan_code’,

I actually submitted a ticket about this a couple days ago.

Check it out here:


Hopefully this will be implemented.

I guess it would require major work but it would really simplify things a lot

what MarcS said is correct better follow it