Hardist
07-25-2012, 07:28 AM
Sorry for the lame title. What I need is some advice on how to do what I want to do. I have made my own administration "program" in PHP, where I can also insert expenses and incomes, and invoices and such which I am getting. I have one table in the database called "bank" with one field called "current". Each time I am adding an income into the database, the amount I enter will be added to the "current" field. Whenever I enter an expense, it will be substracted.
But, whenever I make some typo, I need to edit the stuff. I have an edit page where I can easily edit the income or expense amount that I entered before. But that also means I need to add or substract the changes from the "current" field aswell. This isn't really the best way I guess, but I didn't try it yet to do it like this to be honest.
Another way is to simply use php to add every income and substract every expense, and display what's left as a total current bank amount. But also that I think wouldn't really be the best way.
Any ideas of how to handle this easily? You can also post some code snippets if you would like to, but I don't really need any difficult codes and such, I just need an idea for a simple solution which I can work out myself.
Thanks in advance for any replies I will be getting :)
But, whenever I make some typo, I need to edit the stuff. I have an edit page where I can easily edit the income or expense amount that I entered before. But that also means I need to add or substract the changes from the "current" field aswell. This isn't really the best way I guess, but I didn't try it yet to do it like this to be honest.
Another way is to simply use php to add every income and substract every expense, and display what's left as a total current bank amount. But also that I think wouldn't really be the best way.
Any ideas of how to handle this easily? You can also post some code snippets if you would like to, but I don't really need any difficult codes and such, I just need an idea for a simple solution which I can work out myself.
Thanks in advance for any replies I will be getting :)