Database best practice (+ PHP)

Soldato
Joined
7 Nov 2005
Posts
4,958
Location
Widnes
Hi guys,

Assume you have one table for Teams and one table for Players.

If you wish to assign one player per team as the team admin (e.g. to sign up for events, etc) would you add a field to the Team table (e.g. AdminID being the player's ID) or would you add a field to the player ID (AdminFor being the team ID)?

I would like to future proof it so that a player could be admin for multiple teams. This would therefore suggest going for option 1, but I would need to query the Team table every time I display the player's interface to check if they are an admin of any of the teams in the database. Would this still work if you wanted to allow multiple players to be an admin for a team?

Any suggestions for best practice?

Thanks!
 
Back
Top Bottom