Not the usual case of just knowing how to "insert" checkboxes into the database , I have a form with several checkboxes ...about 25 checkboxes each with the same name and values from 1-25 , Now the thing is I need them to have the same name in order to run a script which prevents the selection of no more than 4 checkboxes ...
HTML Code
<input type="checkbox" name="ckb" id="EngineeringWorkshops" value=1 onclick='chkcontrol(0)';>
<label for="EngineeringWorkshop"> Engineering Workshops </label>
PHP Code
$engineeringworkshops = mysqli_real_escape_string($dbcon, $_POST['cob']);
$sql="INSERT INTO courses (studentid, engworkshops)
VALUES ('$studentid', '$engineeringwokshops')";
engworkshops column type is tinyint(4) default value set to 0
name="ckb[SOME_ID]"orname="ckb[]"if you can identify them uniquely by the values.name="ckb[1]"name="ckb[25]"and useisset()on the server-side to see which ones were checked.