php/mysql checkbox arrays

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
darshanpm
Forum Newbie
Posts: 1
Joined: Sun Feb 08, 2009 11:13 pm

php/mysql checkbox arrays

Post by darshanpm »

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
Post Reply