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