So I have an array of checkboxes that get populated for each row in a table like so:
Now, I need to post back to the database whether or not the checkbox is checked to update the record.
This works as long as the checkbox is checked like so:
The HTML specification says that the checkbox will not post if it isn't checked. How do I update those records??
Code:
<input type='checkbox' name='chk[]' value='<?php echo $ID;?>' <?php if($info == 'YES') echo 'checked'; ?>/>
Now, I need to post back to the database whether or not the checkbox is checked to update the record.
This works as long as the checkbox is checked like so:
Code:
$info = $this->input->post('chk');
foreach ($info as $ID)
{
$this->db->query("UPDATE ModelEvents
SET info = 1
WHERE ID = $ID
AND EventID = $EventID");
}
The HTML specification says that the checkbox will not post if it isn't checked. How do I update those records??