Let's say that the value is stored in a row called ok:
<FORM name="yourform">
<input name="ok" type="checkbox"
<?php
$query = <build query here>;
$res = mysql_query($query);
$ok = mysql_result($res,0,"ok");
if ($ok="Y") print " CHECKED";
?>
<BR>
<input type="submit">
</FORM>