hey guys! this is my first post to daniweb. and also i've not been so long on php.
i m trying to manage customer transection records but stuck on one place and i need help..
here is my mysql table for transection of customer id-1 =>
+-----+------+----------+--------+------+-------|
| svn | cid | date | samt | rvn | ramt |
|-----+------+----------+--------+------+-------|
| 1 | 1 | 2014/3/1 | 5000 | | |
| | 1 | 2014/3/4 | | 2 | 2000 |
| 4 | 1 | 2014/3/7 | 4000 | | |
| | 1 | 2014/3/9 | | 5 | 2000 |
+-----+-------+---------+--------+------+-------|
and in php i wish this to be dispalyed as =>
ledger for => John
+-----+-----+----------+---------+------+---------+
| svn | rvn | date | sales | ramt | balance |
|-----+-----+----------+---------+------+---------+
| 1 | | 2014/3/1 | 5000 | | 5000 |
| | 2 | 2014/3/4 | | 2000 | 3000 |
| 4 | | 2014/3/7 | 4000 | | 7000 |
| | 5 | 2014/3/9 | | 2000 | 5000 |
+-----+-----+----------+---------+------+---------|
| Total | 9000 | 4000 | 5000 |
+-------------------------------------------------+
i've retrived everything except the 'balance' column. i failed to manage the balance record after each transection. please help me find solution for this and please with explanations.
thank u in advance...