Hi, I have a form that has a checkbox in it. When the checkbox is clicked a 1 is saved in my database. I would like the user to be able to see that checkbox checked every time they login. I know how to display the checkbox as checked but is there a way to display the checkbox as checked only if there is a 1 in the database.
here is my current code.
$r1a=0;
if (isset($_POST["r1a"])) {
$r1a=1;
$sqlUpdate = mysql_query("UPDATE finances SET r1a='$r1a' WHERE mem_id='$id'");
}
<form action="Finances.php" enctype="multipart/form-data" method="post" name="checkform" id="checkform">
<input type="checkbox" name="r1a" value="1"/>
<input type="submit" name="button1" id="button1" value="Submit" /></form>