i have a series of checkboxes that dynamically check my mysql database when entering the page to see if they should be checked (value of 'Y' present in a string).
This works fine when i enter the Ys and Ns directly into the database (Y, N, N, Y) but just submitting the form becomes a problem because the unchecked boxes don't post a value, therefore causing not enough values to be in the imploded array that gets sent to the db table column.
so really what i need to know is whether or not there is a way to have an unchecked checkbox post a value, informally 'N', and definitely using PHP?
thank you
oh, and here's a section of the code:
//on load
$querybox = "SELECT artwork FROM gallery WHERE mem_id = '$m'";
$resultbox = mysql_query($querybox);
$rowbox = mysql_fetch_array($resultbox, MYSQL_NUM);
$artwork = explode(', ', $rowbox[0]);
?>
<input type="checkbox" name="artwork[]" <?php echo ($artwork[0] == 'Y') ? 'checked' : ''; ?> value="Y">painting<br>
<input type="checkbox" name="artwork[]" <?php echo ($artwork[1] == 'Y') ? 'checked' : ''; ?> value="Y">illustration
<br>
//etc etc.
//this part once submitted:
$boxes = $_POST['artwork'];
$artwork = implode(', ', $boxes);
$querycheck = "UPDATE gallery SET artwork='$artwork' WHERE mem_id = '$m'";
$resultcheck = mysql_query($querycheck);