I have 80 checkboxes on my page ; these checkboxes belongs to some options for product..
i store them like this
<input type="checkbox" name="options[]" value="<?php echo $row['value]?>"/>
DataBase Structure
**Product_id** | **Option_id**
1 16
1 45
1 68
1 78
1 80
the question is , how should i update options? when user go update page , user should able to see checked options and unchecked too.. How can i show checked options?
i store option values in database too , like this
**id** | **Option_id** |
1 16
2 45
3 68
4 78
....
....
80
Thank you very much for your help , sorry for my english..
Have a nice day
To show them checked on the Front End
Let’s say that you have the result of the product’s options in array called
$checkedwhile looping the checked to print them use this
For the update there is a lot of ways the simplest one is to
Remove all the options and then add the new checked one
Hope this will help