Answer the question
In order to leave comments, you need to log in
Reasons for double insertion of data in Yii2?
I am inserting data:
public function actionInsert($id,$barcode){
if(Yii::$app->request->isAjax){
if(Yii::$app->request->isGet){
$id_barcode=Probirki::findOne(['barcode'=>$barcode])->id;
Yii::$app->db->createCommand()->insert('worklist_probirki', [
'id_probirka' => $id_barcode,
'id_worklist' =>$id,
])->execute();
return $this->redirect('/laboratory/worklist/spisok?id='.$id);
}
}
}
Answer the question
In order to leave comments, you need to log in
In the debug panel, see how many times this request is executed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question