Jump to content

updating stats in a mysql db table nightly/weekly


sws

Recommended Posts

Hi, Question here.

I am trying to start a fantasy sports site where I've got a table for nhl_players and nhl_teams. Both of these tables hold stats for each player and each team respectively. I have to update these tables nightly. But also have to capture individual daily and weekly stat accruals.

How can I do this without over-writing the data in the table each night ?  Do I need separate tables for each day? 

I need to show the entrants point totals for the entire season based on the players they've picked but I'd also like to show the points they've received per day and per week.

Can somebody please tell me how to do this ?

Also, I'm updating the stats manually every night. This is extremely tedious. I know there are services like stats.com which provide live streaming stats but they want 10's of thousands of dollars for that. I don't have that kinda money yet.

Does anybody know if the major sports sites like espn in usa or tsn in canada offer xml files or anythig ?

Currently I just copy the data from espn for each team, create a text file and import it into the db.

Any input would be greatly appreciated.
Link to comment
Share on other sites

Anything you want to do can be done, but trying to get a complex handler made on a forum where basic questions can be answered is rather difficult. If you can give me complete overview of everything, like where the data is coming from, your complete database layout and also the scripts that are showing this data, then I can help you do what you want in the best way. It will be so much better than adding a hack for each thing you want to do. If you want me to look at just send me a PM and I will give you my email so I can show you how to do this dynamically which will allow you more time to monitor your site and not the back end which should shouldn't need monitoring if you design it right.


Sonia
Link to comment
Share on other sites

Thanks Sonia,

I sent you a pm containing my email.

Basically, I have a table containing the nhl_players (all their stat categories), an nhl_teams table (containing all team stats), an nhl_managers table (containing all contest entrants user id and all the player id's for the players they've picked for their roster). They submit their picks to the nhl_managers table via a form that I created which contains 28 drop down menus which are populated dynamically with all the player names.

I then display the pool results using a query that shows the username and a total of all points for all players they've selected.

Right now that's where I'm at right now.

Now, I need to be able to let them change their picks every sunday night.  When they change their picks, I need to be able to update their rosters but not loose the points they've accquired up till now from their old rosters.

I also need to somehow find a better way to update the player and team stats so it's not such a long manual tedious process.

Thanks,

Barry
Link to comment
Share on other sites

might not be the answer you were looking for, but you could just use:

http://hockey.fantasysports.yahoo.com/hockey/

or another good place where you can download stats is:

http://www.sportsinteractive.com/Stats.asp

i think they also let you set up pools there too.

and there is no programming involved
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.