dannybrazil Posted January 22, 2010 Share Posted January 22, 2010 Hello I have a table that contains date and amount of money I earned that day. every day I add on row How can I make a code that will calculate the TOTAL earnings till today...and will continue automatically every day ex: Date Amount 1-1-2010 10$ 2-1-2010 20$ Total income is :30$ *and tomorrow it will update alone Quote Link to comment https://forums.phpfreaks.com/topic/189467-adding-numbers-from-database/ Share on other sites More sharing options...
wildteen88 Posted January 22, 2010 Share Posted January 22, 2010 If you're using MySQL database then you can calculate this within your query using the MySQL SUM() function, example usage can be found here Quote Link to comment https://forums.phpfreaks.com/topic/189467-adding-numbers-from-database/#findComment-1000087 Share on other sites More sharing options...
dannybrazil Posted January 22, 2010 Author Share Posted January 22, 2010 Exactly this THANKS Quote Link to comment https://forums.phpfreaks.com/topic/189467-adding-numbers-from-database/#findComment-1000090 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.