multiple values insertion of checkbox only last value is taking in database

后端 未结 3 1135
自闭症患者
自闭症患者 2021-01-15 19:33

I need to insert more than one values in checkbox but now it is seemed to be only the last value am entering is inserting to database.

this is my HTML code

3条回答
  •  离开以前
    2021-01-15 20:32

    If you want to save multiple values in database then you need to create multiple checkboxes in html and then save the values with implode() method as below:-

    
    
    
    
     
    
    

    now to store in database you can use implode() method.

    $values=implode(",",$_POST['product']);
    

    now store the $values in the database.

提交回复
热议问题