form submit not working

前端 未结 2 383
陌清茗
陌清茗 2021-01-26 17:55

I have a table that prints out all available cameras. It uses a form to change these settings. The problem is that the form only updates the last camera in the entry. In other

2条回答
  •  时光取名叫无心
    2021-01-26 18:43

    Your form element names are clashing. When you define a form element e.g. 'camera_status' twice, you will only receive the last value in the POST.

    Use form array notation, e.g.: "camera_status[]" or even better "camera_status[$id]". Then your PHP code will recieve arrays as POST data and you will be able to update everything at once.

提交回复
热议问题