in that I have thefFields: Refrence, OrderID, EventID, TicketType and Qty
I can put together a query no problem which can list the tickets sold for a certain event.
<?php $event = mysql_real_escape_string(trim(stripslashes($_POST['event']))); $query = "SELECT * FROM TicketsSold WHERE EventID = '$event'"; $results = mysql_query($query) or die(mysql_error()); ?>
But, is there a way that I can instead of listing eveything, total up everything into groups.
For example have it list by EventID then total the amount sold in each ticket type, Adult, Child, Senior, Family and Present.
Many thanks for any help.
(if this would be better in the MySQL Forum then sorry, as I was unaware what it would come under)