I had a look at checkbox value 0 or 1 but am a little confused.
In the DB, columns hosting, complete_setup, and legal_compliant are either 1 or 0, if the user checks the checkbox, it updates it to 1:
<div class="form-group <?php echo (!empty($complete_setup_err)) ? 'has-error' : ''; ?>">
<label>Complete Setup</label>
<input type="checkbox" class="form-control" name="complete_setup" value="1" />
<span class="help-block"><?php echo $complete_setup_err; ?></span>
</div>
But what I would like, is if in the db it is already 1 the the checkbox to already be checked and if it is unchecked it to update the DB to 0. How do I make it return the value 0?
Thank you!