2
我已经在我的控制器下面的代码:如何在没有createCommand的情况下从数据库检索信息?
$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
负责检索类型的产品。 (例如,如果产品的名称是HP,并且type($gettype)
是PC,则它将显示类型为PC的HP产品)。没有createCommand
,我无法实现此功能。我该怎么做?