HTML CODE :
<input type='checkbox' name='cbox[]' value='Jaywalking' />
Jaywalking<br>
<input type='checkbox' name='cbox[]' value='Littering'/>
Littering<br>
<input type='checkbox' name='cbox[]' value='Illegal Vendor' />
Illegal Vendor
POST CODE:
if(is_array($_POST['cbox'])) $violation_save=implode(',',$_POST['cbox']); else $violation_save=$_POST['cbox'];
mysql_query("UPDATE tblcitizen SET violation='$violation_save' WHERE id='$id'") or die mysql_error());
What is the easiest way to retrieve checked checkbox value into the database? What is the proper way to retrieve it base on my code?
Littering
Illegal Vendor that is my form sir – user3397748 Mar 09 '14 at 07:51