Welcome to Stav Cinemas
At the moment, the code is this:
<?php
$result = mysql_query("SELECT (COUNT(bookings.orderID) * prices.priceCost) AS price, customerFirstName, customers.priceID FROM bookings, customers, prices WHERE bookings.custID = customers.customerID AND customers.priceID = prices.priceID GROUP BY bookings.custID, customers.customerID");
while ($row = mysql_fetch_array($result))
{
echo $row["customerFirstName"] . " " . $row["price"] . "<br />";
}
?>
You can see the output in the link.
The number next to each person is how much they have spent on the site in total. Now, how do I total this all up in the SQL query (the while loop will have to go once there's a single piece of data)?


Sign In
Create Account


Back to top









