Currently I am Using this query
$presentRecords= Yii::app()->db
->createCommand()
->select('productId')
->from('exhibitorproducts')
->where(array('and',"exhibitorId=$exhibitorIdentity",
array('in','productId',$productRecords)))
->queryColumn();
But the problem with this query is that I am using $exhibitorIdentity and $productRecords directly. I think that it is dangerous. So how can i bind these values?