search

Home  >  Q&A  >  body text

Hello, after I changed ADD to save, it always prompts that the modification failed, but if it is add, it can be added successfully. What is the situation?

Hello, after I changed ADD to save, it always prompts that the modification failed, but if it is add, it can be added successfully. What is the situation?

En_AnswerEn_Answer2693 days ago1408

reply all(3)I'll reply

  • Gread

    Gread2019-05-29 19:47:35

    In the edit method, you also need to get the id from the hidden field and save it to data[] $data['id']=I('id');

    reply
    0
  • DayDayUp

    DayDayUp2017-08-10 09:21:16

    For example, if you use the ID field as a condition to update a data row, you must pass in the ID field as a condition. And you need to add a hidden field, assign the ID to it and submit it as a form. The ID of the previous page can no longer be used

    <input type="hidden" name="id" value="{$info.id} " />

    reply
    3
  • 大家讲道理

    大家讲道理2017-08-09 17:55:33

    To modify, please add a hidden field to the ID value of the incoming article on the submission page

    reply
    2
  • Cancelreply