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

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Using jquery append to add option values into a select element not working -

javascript - Restarting Supervisor and effect on FlaskSocketIO -