Jump to content


Link between table.

  • Please log in to reply
1 reply to this topic

#1 kee1108

  • Members
  • PipPip
  • Member
  • 12 posts

Posted 30 August 2006 - 01:13 PM

Hope someone can help me out.

I have two tables in mysql, one is showing all the personal information of a group of athletes (also store an indicator to show wheather they are injured or not).  I am planning to create another table to store all the players with injuries and their type of injury.

So my question is, is it possible if I want to call for a table for all the players that is with injuries (I want to show their info as well as the type of injury from the 2nd table.)

Hope someone can help me out or give me some direction on how to do it.

Or is there a easier way to do this?

Thank you.


#2 ober

  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 30 August 2006 - 01:18 PM

So let me get this straight:

Table 1:
personid | athlete | sport | height | weight | etc

You want to add Table 2:
personid | injury | type_of_injury


That's how it should be structured.  Then when you want to find out the people that have injuries, you can use a JOIN or a UNION between the tables to gather the information from both.  I suggest you read up on those two items on the mysql website to get a better understanding of how to join data.

Info: PHP Manual

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users