lukep11a Posted July 5, 2011 Share Posted July 5, 2011 Hi, I have two tables, one called 'selections' with 12 columns, each holding 1 team name, the other table is called 'teams' and in that table is a list of all 92 teams and the number of points they have so far. Is it possible to set a table to automatically add up the points totals of the all 12 teams in each row of the 'selections' table and store the result in another column? Sorry I do not have any code for it yet as don't really know where to start. Any help would be much appreciated or if you could point in the direction of a tutorial that could help that would be good too. Quote Link to comment https://forums.phpfreaks.com/topic/241124-automatically-update-table-column/ Share on other sites More sharing options...
dcro2 Posted July 6, 2011 Share Posted July 6, 2011 This should probably be in one of the database forums, but I think MySQL triggers would be what you want. They basically run after whatever event you want occurs, so you can add up the points. http://www.rustyrazorblade.com/2006/09/mysql-triggers-tutorial/ Quote Link to comment https://forums.phpfreaks.com/topic/241124-automatically-update-table-column/#findComment-1238804 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.