update check box
Hi, I am having trouble in updating the checkboxs in dreamweaver. Currently, when I try to insert the data, everything seem like working well for me but when I try to update the data, the checkboxs only an show an empty box. How can I retrieve the data so that whatever i have check previously appears on the checkbox? Can anyone help me? I will really appreciate it. Thank you.
update.php
=========
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
// convert the checkbox group subarray to a string
if (isset($_POST['requirement'])) {
$_POST['requirement'] = implode(',', $_POST['requirement']);
} else {
$_POST['requirement'] = 'none';
}
$updateSQL = sprintf("UPDATE requirement SET event=%s, requirement=%s, facilities=%s, other=%s WHERE matrix=%s",
GetSQLValueString($_POST['event'], "text"),
GetSQLValueString($_POST['requirement'], "text"),
GetSQLValueString($_POST['facilities'], "text"),
GetSQLValueString($_POST['other'], "text"),
GetSQLValueString($_POST['matrix'], "text"));
mysql_select_db($database_localhost, $localhost);
$Result1 = mysql_query($updateSQL, $localhost) or die(mysql_error());
}
<tr valign="baseline">
<td nowrap="nowrap" align="right">Requirement:</td>
<td><input type="checkbox" name="requirement[]" value="Plug" id="requirement_0"<?php echo((in_array("Plug", explode(", ", $row_get_other['requirement'])))?"checked=checked":""); ?>/>
Plug</td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="checkbox" name="requirement[]" value="Pen" id="requirement_1"<?php echo((in_array("Pen", explode(", ", $row_get_other['requirement'])))?"checked=checked":""); ?>/>
Pen</td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="checkbox" name="requirement[]" value="Goodies" id="requirement_2"<?php echo((in_array("Goodies", explode(", ", $row_get_other['requirement'])))?"checked=checked":""); ?>/>
Goodies</td>
</tr>