I will show you an example that you can adapt to your need.
In the html form:
<form action="nameofphpscript.php" method="post">
Want to go home?
<input type="checkbox" id="homepage" name="homepage" value="1" />
<input type="submit" name="formSubmit" value="Submit" />
</form>
in the 'nameofphpscript.php' file:
<?php
$status = '0';
if(isset($_POST['homepage']) && $_POST['homepage'] == '1')
{
$status = $_POST['homepage'];
}
$mysqli = new mysqli('localhost', 'username', 'password', 'databasename');
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$stmt = $mysqli->prepare("UPDATE tablename SET checkstatus = ? WHERE userid = 'bill123'");
$stmt->bind_param('s', $status);
$stmt->execute();
$stmt->close();
$mysqli->close();
?>
Hope it is helpful.