Hello everyone.. this is my php code
<div class="content-1 col-sm-12 nopadding">
<div class="list-header col-sm-1">Date</div>
<div class="list-header col-sm-2">Product</div>
<div class="list-header col-sm-2">Username</div>
<div class="list-header col-sm-1">Quantity</div>
<div class="list-header col-sm-1">Rate</div>
<div class="list-header col-sm-1">Sale Amount</div>
<div class="list-header col-sm-1">Payment</div>
<div class="list-header col-sm-1">Balance</div>
<div class="list-header col-sm-1">Remarks</div>
</div>
<?php
$sql = "SELECT * FROM sale_history order by date ASC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<div style='background: #e3e6e1;' class='col-sm-12 nopadding'><div style='padding-left: 5px !Important;' class='list-content col-sm-1 nopadding'>" .$row['date']."</div>";
echo "<div class='list-content col-sm-2'>" .$row['product']."</div>";
echo "<div class='list-content col-sm-2'><a href='edit_user.php'>" .$row['username']."</a></div>";
echo "<div class='list-content col-sm-1'>" .$row['quantity']."</div>";
echo "<div class='list-content col-sm-1'>" .$row['rate']."</div>";
echo "<div class='list-content col-sm-1'>" .$row['sale_amount']."</div>";
echo "<div class='list-content col-sm-1'>" .$row['payment']."</div>";
echo "<div class='list-content col-sm-1'>".$row['balance']."</div>";
echo "<div class='list-content col-sm-1'>" .$row['remark']."</div></div>";
}
}
else {
echo "0 results";
}
?>
output of this code will be
i want to add a delete button in each row. which button will delete this row from database, also upate balance row in another table.
Please help me...