Insert query in yii2.0 framework -
i using yii 2.0 framework , can me write insert query in controller please, writing query this, proper query
$userid = \yii::$app->user->identity->id; $restid = \app\models\restaurantbusiness::find()->select('restaurentid')->where(['userid' => $userid ])->one(); $restdetailid = $restid->restaurentid; $restomenuid = restomenu::find()->insert('restaurantbusiness_restaurentid')->where(['restaurantbusiness_restaurentid' => $restdetailid])->one();
please me write correct insert query. in advance
ok assume no 1 knows :-/
i found solution
there no need write insert query @ all, in controller before saving wrote this
$model->restaurantbusiness_restaurentid= $restdetailid;
thats all.
Comments
Post a Comment