jmcall10 Posted August 6, 2008 Share Posted August 6, 2008 Hi, Ok I am starting a project again as I think my database design was wrong from the start. The project is to do with five a-aside football. What I am after is to be able to store the following then refference it later on using php. For just now I am interested on how I should design the database. I.e. tables fields etc I want to store the following and be able to make calculations on the data: Players names (unlimited number of players can be stored) Game info (i.e what 10 players played a game on a certain date and which 5 won and which 5 lost, or if it was a draw) What I am wanting to be able to do is create a leage with this info and display the top players. Once I have got a good database design I will then move on to the php section and start to create the script for that. Thanks in advance jmcall10 Quote Link to comment Share on other sites More sharing options...
Xurion Posted August 6, 2008 Share Posted August 6, 2008 Looking at the info you need to store, I'd have the following tables: games teams players The games table would have a column for the home team and a column for the away team. Also a columns for the home side score and away side score. The teams table would simply have a column for the name of the team, a column for their current points/score and one for an id. The players table would have players linked to their team referencing the id from the teams table. When a game ends, winning players should have their score column raised by 1. If you want to award players for a draw then you may have to change the way this score works (maybe 2 for win, 1 for draw and 0 for lose). Quote Link to comment Share on other sites More sharing options...
jmcall10 Posted August 6, 2008 Author Share Posted August 6, 2008 You are on the right track, however as it is a five asides game the teams change every week and are not fixed. So there is no need to keep track of team points as there are no official teams. I only want to track the players points depending on if they win lose or draw. I hope this makes sense to someone somewhere Thanks again Quote Link to comment Share on other sites More sharing options...
Xurion Posted August 6, 2008 Share Posted August 6, 2008 Ok, going on what you've said, simply take out the table for teams. That logic will work without it. The games table might benefit from having ten columns, away_player_1, away_player_2 etc. 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.