Hi, im newish to processing data with PHP, and im stuck on something at the moment.
Here is what im trying to achieve:
1) I need to get a unique list of customers from the mysql database for the chosen month/year
2) For Each customer that is found I need to add up the total of "COLUMN1" "COLUMN2" and "COLUMN3" for the chosen month/year
3) Display the results in a table, listing the total for each customer.
It sounds simple when i look at what I need to do, but im stuck 🙁
Here is some example data:
ID COLUMN1 COLUMN2 COLUMN3 MONTH YEAR CUST
1 3 2 1 March 2003 TEST
2 4 2 4 January 2004 TEST1
3 4 2 1 January 2004 TEST2
4 5 3 5 June 2004 TEST3
5 2 4 3 February 2004 TEST4
So, for example, The user has selected all records from January 2004. The results in the Table should be:
Customer Total
TEST1 10
TEST2 7
So, can anyone offer any pointers on the best method to do this?
Many thanks in advance