So, that is what you wanted to do! Good!
Now to retrieve the checkboxes, you read the value into an array.
You just do a query against the database and get the value of the stored “days”.
Load it into a new array of $days , same as before.
This becomes a list of the previous checkbox values, in this case something like: (“Monday”, “Wednesday”)
In that example, I selected only two days… Now, to use this to put back into a list of checkboxes, you
will need to parse thru the array of days and mark each which exists as “checked”.
So, to display your checkbox using PHP, it would look like this:
And, if it is checked, it would be like this:
So, get the days from the database into your $days variable. Then, on each checkbox, use this for the displayed value of the checkbox:
<input type=“checkbox” name=“days[]” value=“Monday” <?if(in_array("Monday", $days)){echo " checked";}?>/>
This will check for “Monday” in the array “$days”. If found, it adds the " checked" option to the checkbox.
Please note that you will have to do this for each checkbox displayed. If Tuesday, if Wed… etc…
Hope that helps!