I am working on ecommerce cart page. I already done the cart but I need the grand total. Please help
<?php
$query = mysqli_query($conn,"select * from cart where usr_id = '".$_SESSION['id']."'");
while($row=mysqli_fetch_array($query))
{
$per_price = $row['price'];
$per_quantity = $row['quantity'];
$total_amount = $per_price * $per_quantity;
?>
<tbody>
<tr>
<td><?php echo $row['name']?></td>
<td>RM <?php echo $row['price']?></td>
<form class="no-margin" method="post">
<td><input class="form-1" type="number" name="quantity" value="<?php echo $per_quantity?>"></td>
<td>RM <?php echo $total_amount?></td>
</tr>
</tbody>
<?php
}
?>