I tried the code you posted, although I didn't understand it, and it didn't work for me.
Here's the way I'm going about the ready_for_enrollment field right now:
First I set it to a variable using a while statement:
while ($row = mysql_fetch_array($result)) {
...several rows here...
$ubd3_notes = $row['ubd3_notes'];
$ready_for_enrollment = $row['ready_for_enrollment'];
}
Then, in the actual form where it's supposed to show if the box is checked or not I have the following form code:
<input type="checkbox" name="ready_for_enrollment" id="ready_for_enrollment" value="yes"
<? if ('$ready_for_enrollment'=='yes') { echo ' checked '; } ?>>
Finally, as part of the SQL UPDATE clause in the processing page I have the following code:
$sql = "UPDATE $table_name SET
...some more fields here...
ubd3_notes = '$_POST[ubd3_notes]',
ready_for_enrollment = '$_POST[ready_for_enrollment]'
WHERE date_id = '$_POST[date_id]'";
However, when I click the submit link I get the following error message when the box is NOT checked:
Undefined index: ready_for_enrollment in ... on line 68
And when the box IS checked it just doesn't save it as checked.
Any more suggestions?
Thanks,
S./
Website:
http://www.villainsvalley.net/