I am pulling some data from MySQL with PHP. I have added a ORDER by ID ASC clause to the query and this gives me results in the desired order.The ID column is the incrementing ID in MySQL to ensure uniqueness. What I want to do is as follows:
ID Payment Accumulated Totals
1 £200 £200
2 £325 £525
5 £205 £730
7 £100 £830
As I am still a newbie, I am wondering how to implement the Accumulated totals column as shown above. I am thinking there should be some formula to work out accumulated totals in each row. I have failed to work out something though I am battling with this problem right now and will post code once I come up with something whether or not it works just to show my efforts.
Any help or guidance will be greatly appreciated.