>- see footer for list info -< If you store all the player match stats in a table then you can use SQL to generate the totals using aggregate functions. The way you are going about it is very labour intensive.
If you need more advice about that then let us know. On 9/7/05, RichL <[EMAIL PROTECTED]> wrote: > >- see footer for list info -< > This may be a tad difficult to explain but I'll try... > I need help with the best way to approach this problem.. I am thinking > maybe a combination of structures and arrays but I'm not very experienced > combining them or using structures... > I have a DB holding football data about a team and players.... > There is a table called MatchPlayer which holds data about all the players > in a squad for each game of a season.. so it gets updated each week with 25 > records.... one for each squad member for the last game...and holds details > about their position for that game, goals scored, yellow cards, red cards, > etc > There is another table called Player, which holds details about a player's > total stats for the season and has one record per squad member and has total > goals, yellows, reds etc. > What i would like to do is write a page to update this Player table with > info from MatchPlayer, by looping around all the records in MatchPlayer (25 > * amount of games so far) and for each player making a sum of the goals, > yellow, red cards etc. from each of the matches to make a season total > Then I want to go and update the Player table with this data > I am not sure of the best way to approach this and hold the data before > doing the update to make sure I am doing it efficiently. > The data I end up with will be something like > goals1=1 > goals2=0 > goals3=1 > ... up to 25 > yellow1=0 > yellow2=0 > yellow3=1 > upto 25 > red1=0 > red2=0 > red3=1 > upto 25 > where each number appended to the variable name represents a playerid in > Players table. > Is it best to try and store all this in an array and structure combination > e.g. a 25 element array each element representing a player, where each > element has a structure which contains goals, yellows, reds that represent > the data for that individual player? > Then when doing the updateto Players.... I loop through each array element > to update each player and within each element loop through the structure > keys to update the individual stats for that player? > I am quite keen to start using struct/arrays more and this seemed like > perhaps candidate data/logic for doing so? > (If you're still with me and have the inclination to answer - thanks !) > > -- > Rich > _______________________________________________ > > For details on ALL mailing lists and for joining or leaving lists, go to > http://list.cfdeveloper.co.uk/mailman/listinfo > > -- > CFDeveloper Sponsors:- > >- Hosting provided by www.cfmxhosting.co.uk -< > >- Forum provided by www.fusetalk.com -< > >- DHTML Menus provided by www.APYCOM.com -< > >- Lists hosted by www.Gradwell.com -< > >- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -< > -- Simon Baynes www.simonbaynes.com _______________________________________________ For details on ALL mailing lists and for joining or leaving lists, go to http://list.cfdeveloper.co.uk/mailman/listinfo -- CFDeveloper Sponsors:- >- Hosting provided by www.cfmxhosting.co.uk -< >- Forum provided by www.fusetalk.com -< >- DHTML Menus provided by www.APYCOM.com -< >- Lists hosted by www.Gradwell.com -< >- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<
