I have following code in my controller:
$listproduct=Yii::app()->db->createCommand()
->select('product')
->from('product_form')
->where('product_name=:product_name and type=:type', array(':product_name'=>'HP', ':type'=>$gettype ))
->queryRow();
$gettype
is responsible for retrieving types of the product. (e.g if the name of the product is HP and type($gettype)
is PC, it will display the HP product where type is PC). I could not realize this function without createCommand
. How can I do it?