【发布时间】:2014-05-10 16:16:22
【问题描述】:
我已从数据库中获取这些杂货产品值。客户可以在相应的文本框中输入他们的数量。现在,我想将这些值再次存储到具有数量值的数据库表中。我怎样才能做到这一点?我可以使用输入文本字段插入数据。但是,这里我有来自数据库的值。
如何重新插入这些数据?
<form name="form1" action="" method="post" class="groceries-form">
<?php
$sql_records = "SELECT * FROM ".tbl_groceries."";
$records = mysql_query($sql_records,$CN);
while($rows = mysql_fetch_array($records))
{
?>
<tr class="itemrow">
<td style="text-align: center;"><?=$rows['ID']?></td>
<td class="name"><span code="18" class="iname" type="text"><?=$rows['item_title']?></span></td>
<td class="qty"><input maxlength="2" class="tqty orderbox" type="text" name="quantity"></td>
<td class="qty1"><?=$rows['price']?></td>
<td class="qty1"><?=$rows['mrp']?></td>
<td class="qty1"><?=$rows['savings']?></td>
</tr>
<?php } ?>
<input type="submit" name="submit" value="Submit" class="submit"/>
</form>
【问题讨论】: