It's nearly 1 AM here (US central) and I just thought about doing this checklist, but I'm not sure how.
My DB:
id | user | gadget | checked
The form:
<form>
<input type="checkbox" name="gadget" value="gadget1">Gadget One<BR>
<input type="checkbox" name="gadget" value="gadget2"> Gadget Two<BR>
<input type="checkbox" name="gadget" value="gadget3"> Gadget Three<BR>
</form>
Now what I want to do is like a checklist. If they have gadget 1 and 3 and they check the box, then it enters into the database, but not 2.
if($gadget==checked)
{
$table =checklist;
$checked=1;
$sql = "INSERT INTO $table VALUES('$id','$user','$gadget','$checked')";
}
Must I assign a different name to each checkbox and do an if statement? There will be a lot of these (over 200). There's gotta be an easier way...hasn't there?
Any suggestions/comments would be helpful. But I will read them later today as I am off to bed now.
Have a nice evening.