Kapil
8/3/2018 - 6:58 AM

adding checkbox in a single field

imploding checkbox datas into a single field in database


                                                    
<input type="checkbox"  value="PDC"  name="course[]" checked  id="alm_true">PDC</label>													
<input type="checkbox" value="B.COM"   name="course[]" >B.COM</label>
<input type="checkbox" value="M.COM"   name="course[]" >M.COM</label>

<?php


$role = implode(",", $_POST['course']);  

//  save $role in db
//  eg of o/p:-         PDC,BCOM,MCOM
//  3 datas will enter in the same field seperated by commas


?>