Jump to content

Link between table.


kee1108

Recommended Posts

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.

-Ricky
Link to comment
https://forums.phpfreaks.com/topic/19137-link-between-table/
Share on other sites

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

Correct?

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.
Link to comment
https://forums.phpfreaks.com/topic/19137-link-between-table/#findComment-82780
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.