php/mysql checkbox arrays
Posted: Sun Feb 08, 2009 11:16 pm
Hi Friends,
I have a form with list of checkboxes that are generated dynamically based on other table in mysql. I save the selected checkbox values in mysql table as a string separated with , (1,2,3,4,5). Now, i want people to edit the form again. It will load the other values of the form and the checkboxes, but i want to have the checkboxes selected which were selected and saved in mysql.
Hope i am clear about what i am looking to do. So, i want to retrieve the checkbox values (1,2,3,4,5) which i have stored earlier and then check against all the checkboxes and selecting them if the value exists in the array. Can anyone help me to do this and provide me some sample code or tutorial link.
Thanks,
Darshan
I have a form with list of checkboxes that are generated dynamically based on other table in mysql. I save the selected checkbox values in mysql table as a string separated with , (1,2,3,4,5). Now, i want people to edit the form again. It will load the other values of the form and the checkboxes, but i want to have the checkboxes selected which were selected and saved in mysql.
Hope i am clear about what i am looking to do. So, i want to retrieve the checkbox values (1,2,3,4,5) which i have stored earlier and then check against all the checkboxes and selecting them if the value exists in the array. Can anyone help me to do this and provide me some sample code or tutorial link.
Thanks,
Darshan