Using array_push() from a collection of tables I have created the array below for a report.
2007-08-21, Interest, Dad, 82.00
2007-09-01, Electricity, Mum, 63.14
2007-08-20, Petrol, Dad, 18.71
2007-09-01, Electricity, Mum, 85.00
2007-08-19, Interest, Dad, 83.00
In the report I want to produce summaries like:
Electricity = 148.00
Interest = 165.00
Petrol = 18.71
And:
Dad = 188.00
Mum = 148.00
The categories like Electricity, Interest, Dad etc will be different depending what the user has entered.
Producing the the basic report is straight forward. Producing the summaries has left me brain dead. I could have obtained the totals from the database but for ease (I thought) and to teach myself how to use multidimensional arrays I tried this approach. Can it be done?