I have a form like below :
Assuming we are using checkboxes with zeros or ones...
Using a hidden checkbox with a zero value is just a work-around. Another work around would be to add 0 to the value when receiving the post or get.
Example:
$chkbx1 = $_POST['chckbx1']; $chkbx1 += 0;
This takes a NULL value an turns it into a zero, but if the value is one, as in its checked, then the value stays the same.
The real issue here isn't inventing a work-around. Its understanding why this is happening. Older versions of mySQL takes null values and converts them into a zero. In newer versions, you must disable strict mode and then a work-around is not needed.