How to save checkbox array in database?

I have this form:\[code\] <tr> <td><input type="hidden" name="ledlamps" value="http://stackoverflow.com/questions/3628355/LED lamps">LED lamps:</td> <td><input class="field checkbox" type="checkbox" name="box[]" value="http://stackoverflow.com/questions/3628355/3mm"/><label class="choice">3mm</label></td> <td><input class="field checkbox" type="checkbox" name="box[]" value="http://stackoverflow.com/questions/3628355/5mm"/><label class="choice">5mm</label></td> <td><input class="field checkbox" type="checkbox" name="box[]" value="http://stackoverflow.com/questions/3628355/8mm"/><label class="choice">8mm</label></td> <td><input class="field checkbox" type="checkbox" name="box[]" value="http://stackoverflow.com/questions/3628355/10mm"/><label class="choice">10mm</label></td> <td><input class="field checkbox" type="checkbox" name="box[]" value="http://stackoverflow.com/questions/3628355/Ovals"/><label class="choice">Ovals</label></td> <td><input class="field checkbox" type="checkbox" name="box[]" value="http://stackoverflow.com/questions/3628355/Assembly LEDs"/><label class="choice">Assembly LEDs</label></td> </tr>\[/code\]and this php code:\[code\] $box=$_POST['box'];$ledlamps = $_POST['ledlamps'];if ($box != 0) {echo "$ledlamps: ";while (list ($key,$val) = @each ($box)) {$val1 = "$val, ";echo "$val1";}}\[/code\]If I output with echo it displays in the way I want it:Led lamps: 3mm, 5mm, 8mm (if i tick the respective checkboxes)But I want to store this in a mysql table field. How do I do that?Thanks for your help!
 
Back
Top