Jump to content

1 Item that is a part of multiple lists.


SeanM

Recommended Posts

Hello,

 

I am an avid gamer, and I am part of a team as well. I am making a simple application online to help with the match organizations and such, but I have come across a problem.

 

I have different teams in a table and I have different players in a seperate table like so -

 

Table Structure for Players Table

CREATE TABLE `players` (
  `playersID` int(4) NOT NULL auto_increment,
  `country` char(2) NOT NULL,
  `bios` text NOT NULL,
  `specs` text NOT NULL,
  `email` varchar(255) NOT NULL default 'Enter E-Mail Here.',
  `xfire` varchar(255) NOT NULL default 'Enter Xfire Here.',
  `games` varchar(255) NOT NULL default 'Tell us what games you are currently playing.',
  `teamsID` int(3) NOT NULL,
  `name` varchar(255) default NULL,
  PRIMARY KEY  (`playersID`)
) 

 

Table structure for teams table

CREATE TABLE `teams` (
  `teamsID` int(11) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `games_played` int(11) NOT NULL,
  `wins` int(11) NOT NULL,
  `losses` int(11) NOT NULL,
  `points` int(11) NOT NULL,
  `gamesID` int(11) NOT NULL,
  `tl_id` int(11) default NULL,
  PRIMARY KEY  (`teamsID`)
)

 

What I want to do, is each player has there own profile, and each player can be part of different teams (4v4 teams, 2v2 teams, etc...). The way I have it setup is that the teamsID corresponds to a teamsID in the players table. So when a player would join lets say teamID 2, then they would each get the same ID and then I can just draw the right players out for each team.

 

But then, what if a player was part of 2 seperate teams? How would I go about setting that up? Thanks

 

Sean

Link to comment
https://forums.phpfreaks.com/topic/82218-1-item-that-is-a-part-of-multiple-lists/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.