I've problems with an do while slope.
I want to update my database but it doesn't work. I want to click the ones they have paid. Can somebody help me?
The code:
Code: Select all
if (isset($row_master['fee'])) {
$fee[] = $row_master['fee'];}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
foreach ($fee as $v) {
$updateSQL = "UPDATE table (fee) VALUES ('$v')";
mysql_select_db($database_tool, $tool);
$Result1 = mysql_query($updateSQL, $tool) or die(mysql_error());
}
}Code: Select all
<?php do {
?>
<tr>
<td><?php echo $row_master['ID']; ?> </td>
<td><input type="checkbox" name="fee[]" value='1' <?php if ($row_master['fee'] == 1) echo 'checked="checked"';?> />
<?php } while ($row_master = mysql_fetch_assoc($master)); ?>
</table>
<input type="submit" value="update" /> </td>
<input type="hidden" name="MM_update" value="form1" />
</form>