Hi Trac,
With that code do you mean it doesn't passes data to the database?? I want a line that passes data from the form to the mysql database to the selected checkbox category_name.
Printable View
if, on each <input>, you use the category_id as the name, then when the form is submitted you will know which category that checkbox belongs to. But if you use some other value (like name="othername"), then you wouldn't be able to tell.
Personally, I would build each input like this:using the same name (the [] make it an array) for each make it easier to access once the form is submitted.PHP Code:'<label><input type="checkbox" name="category[]" value="'.$r['category_id'].'">'.$r['category_name'].'</label>';