<?php
echo "<form action='' method=\"post\">";
echo "<table border='1'>
<tr class='' >
<th> P.Name </th>
<th> P.Size </th>
<th> P.Quantity </th>
<th> P.Price </th>
<th> P.Delete </th>
</tr>";
$query ="SELECT * FROM `order_detail` WHERE `orderID` = $viewID ";
$result=mysqli_query($connection,$query);
while($row=mysqli_fetch_array($result,MYSQL_ASSOC)){
$Id=$row['ID'];
echo "<tr>";
echo "<td> <input type=\"text\" name=product_name value=\"$row[prodName]\"> </td>";
echo "<td> <input type=\"text\" name=product_size value=$row[prodSize]> </td>";
echo "<td> <input type=\"text\" name=product_qty value=$row[prodQty]> </td>";
echo "<td> <input type=\"text\" name=product_price value=$row[prodPrice]></td>";
$query_sting = "Id={$row['ID']}&veiw=$viewID";
$delete_page = "order_delete.php?". $query_sting;
echo "<td><a href='$delete_page' onclick=\"return confirm('Are you sure?');\"><img src='images/DELETE.png'></a></td>";
echo "</tr>";
}
echo "</table>";
echo "</form>";
if(isset($_POST['hitler'])){
$sql ="UPDATE order_detail SET ";
$sql .="prodName = '$product_name', ";
$sql .="prodSize = '$size', ";
$sql .="prodQty = '$product_qty',";
$sql .="prodPrice = '$product_amount' ";
$sql .="WHERE `ID` ='$Id' ";
$result = mysqli_query($connection,$sql);}
?>
thnx in advance
want to update mutiple record
this code is updated the last record only