I want my dynamically (based on data in table) created form to update information in a target table - most of my code works, except for the updating part. Currently, there are no errors messages and the form seemingly submits no or null values and continues onto the directed page once a "successful" submit occurs.
The code for my form which is made up of checkboxs is:
<table>
<form action="<?php echo $editFormAction; ?>" id="TypeSpecForm" name="TypeSpecForm" method="post">
<tr>
<td><div id="ProdTbl">
<p><strong>Which Type of Products?</strong></p>
<table border="1" align="center">
<?php do { ?>
<tr>
<td>
<?php echo '<input type="checkbox"' . " name=" . $row_ProdType['TypeName'] . " id=" . $row_ProdType['TypeName'] . " value=" . $row_ProdType['TypeName'] . '/>'
?>
</td>
<td><?php echo $row_ProdType['TypeName']; ?></td>
</tr>
<?php } while ($row_ProdType = mysql_fetch_assoc($ProdType)); ?>
</form>
</table>
</div>
The code for updating the target table is:
if ((isset($_POST["SubmitList"])) && ($_POST["SubmitList"] == "TypeSpecForm")) {
$updateSQL = sprintf("UPDATE businessprofile SET ProductListing=%s, ServiceListing=%s WHERE Id=" . "'" . $_SESSION['Reg'] . "'",
GetSQLValueString($_POST["{$row_ProdType['TypeName']}"], "text"),
GetSQLValueString($_POST["{$row_ServType['TypeName']}"], "text"));
mysql_select_db($database_dbConnection, $dbConnection);
$Result1 = mysql_query($updateSQL, $dbConnection) or die("Query error in UPDATE query! Query text: $updateSQL<br>Error:" . mysql_error());
Anyone have any ideas on how I can get the form to update the target table? Help resolving my coding problems is very much appreciated.