I've run into an issue I find very confusing. I have a form with one checkbox. I need the form to apply a value of 1 or 0 if the checkbox is checked or not.
<input type="checkbox" name="admin">
Then the PHP, something like this:
$update_data['admin'] = isset($_POST['admin']) ? '1' : '0';
It works if it's checked. I'm not sure how to go about getting the "off" state.