I'm making a simple online booking system using mysql and PHP where people can book out equipment.
There is a limited number of bookable items (10 camcorders, 20 laptops etc). When someone books an item, some of the data stored is the item id (which references the equipment table) and the number booked.
After a simple query for the equipemnt booked an a certain day at a certain time, the table looks like this:
What I need is a table that shows DISTINCT item_id's and the SUM of the number booked for each of these items. So the resulting table would be:
Hope I've explained it clearly. Could someone give me a hand?