model->save() Not Working In Yii2

后端 未结 10 1563
情歌与酒
情歌与酒 2020-12-06 01:10

Previously, I was not using $model->save() function for inserting or updating any data. I was simply using createCommand() to execute query and

10条回答
  •  臣服心动
    2020-12-06 02:09

    Try this:

    $model->save(false);
    

    and if thats working, check your model rules() and your form rules() if its having the same rules. usually the cause is the required fields in your table.

提交回复
热议问题