In my PHP page, I have a while loop that displays the Total of Orders of Customers Table. I want to get the sum of all the Totals values in while loop. This is how the relevant sections of my code look at the moment:
<?php
include'includes/config.php';
$sql ="Select * from new_booking order by order asc";
$re = mysqli_query($mysqli,$sql);
while($row=mysqli_fetch_array($re)) {
$order = $row['order'];
$duration = 12;
$total = $order * $duration;
echo " <p> $total </p>";
// echo "<p> All Sumtotals should display here </p> ";
}
?>
7*12=84
8*12=96
Sum total = 180