I have a table in my database with a few fields. I am using this form to select data from this table:
<form id="#" name="#" method= "post" action="cms_order_detail.php">
<table width="100%" border="1" align="center">
<th> Item </th>
<th> Price </th>
<th> Active </th>
<tr>
<?php
$sql= mysql_query("SELECT * FROM `product` where `item_id` = '$id' AND `type`=0 ");
while($row= mysql_fetch_array($sql)){
$price = $row['price'];
$item_id = $row['item_id'];
$size = $row['size'];
?>
<td class="price"> <?php echo $size;?> </td>
<td class="price" width="1px">
<input type="number" name="pro_price" id="pro_price" value="<?php echo $price;?>" style="width:4.2em; " >
</td>
<td align="center">
<input type="number" name="onof" id="onof" value="<?php echo $row['active'];?>" style="width:2.5em; " min="0" max="1" title="1= active and 0= De-active">
</td>
</tr>
<?php }?>
</table>
<button class="updateBtn"> Update </button>
<div style="clear:both"> </div>
</form>
I have to update the table using MySQL and PHP. How to do it? The screenshot of my web page is as below.
When I click up update button the above rows should be updated. Please see the image for clear message.