bwyant32 Posted March 20, 2012 Share Posted March 20, 2012 Ok I am into sports games for the PS3 and I help run a baseball league for MLB 12 The Show. We currently use a website for stat tracking called LeagueDaddy (http://www.leaguedaddy.com). I created this site (http://www.stlbleague.com) and I am pulling player stats from the LeagueDaddy site and exporting them into my databases. What I would like to do is set up a database structure so we can enter stats on our server and they will be updated in real time. Now I have figured out how to use the .php?id feature (as you can see here http://www.stlbleague.com/tm.php?tid=10). Now I have an idea for a database structure and here it is: Players Table - ID, Name, Photo, Age, other personal info Stats Table - Player ID, and then all the player's stats Teams Table - Team ID, and all the general Team Info Schedules Table - Game ID, Team IDs as the home and away team Those are the 4 major tables that I would need. I already have the players and teams tables set up properly. My question is, how could I get stats to store for each individual game so I could pull standings and many other things? Is this a reasonable idea given what I already have set up? What would you recommend that I look at as for a tutorial on how to do this? There is a site www.nnlcentral.com that already achieves what I want but for a different game; I welcome all tips and suggestions Quote Link to comment Share on other sites More sharing options...
bwyant32 Posted March 20, 2012 Author Share Posted March 20, 2012 Or how much would someone charge to set this up? haha Quote Link to comment Share on other sites More sharing options...
rythemton Posted March 20, 2012 Share Posted March 20, 2012 In the Stats table, I wouldn't store a player's lifetime stats. I'd add the Game ID, and store stats for each player for each individual game. You could then add or average stats whenever you need to, and you'd be able to check stats per game, per season, or lifetime as needed. Make sure to include the game date in the schedules table to help with selecting which games are in a particular season. In the player's table, I'd include the player's current team id, while in the stats table, I'd include the team id he played on for those stats. That way you can calculate team stats, and if a player changes teams, the stats still point to both him and the team he was playing on for that game, with the added benefit that you could calculate an individual player's stats on a per team basis. Quote Link to comment Share on other sites More sharing options...
bwyant32 Posted March 20, 2012 Author Share Posted March 20, 2012 In the Stats table, I wouldn't store a player's lifetime stats. I'd add the Game ID, and store stats for each player for each individual game. You could then add or average stats whenever you need to, and you'd be able to check stats per game, per season, or lifetime as needed. Make sure to include the game date in the schedules table to help with selecting which games are in a particular season. In the player's table, I'd include the player's current team id, while in the stats table, I'd include the team id he played on for those stats. That way you can calculate team stats, and if a player changes teams, the stats still point to both him and the team he was playing on for that game, with the added benefit that you could calculate an individual player's stats on a per team basis. That shouldn't be too hard to add. I do have the team Id in the players table, forgot to mention that. Now how would you go about creating the schedule and posting scores and stats through a web form for each and every game within the schedule? 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.