Luvac Zantor Posted December 14, 2003 Share Posted December 14, 2003 Let me clarify. I have a database that keeps track of football stats based on the weekly games. What ends up happening is that each player ends up with multiple entries based on the week they played. What I want to do is take all those entries, and create an output that adds all the stats. (ie. yards for week 1 and week 2 and week 3, etc..) I was wanting to avoid having to create ANOTHER table to store things in (seemed redundant, since I figure there must be a way to pull multiple rows and \"add\" them together) I\'ve been looking around for a few hours, but must be looking in the wrong place. (online and the PHP Bible). Suggestions? thanks! Quote Link to comment Share on other sites More sharing options...
shivabharat Posted December 15, 2003 Share Posted December 15, 2003 I havent quite understood what you well. But you sound like using a GROUP CLAUSE in mysql . Check manual for more details. http://www.phpfreaks.com/mysqlmanual.php her is an example select fdate,SUM(goals) from <table_name> group by fdate Thsi query will display the date and the total. Dates that are same are grouped as one and only one entry is shown. Quote Link to comment 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.