1

I have 3 table

Player Playerid Player name

Team Team id Player1 foreign key playerid from table(player) Player2 foreiy key playerid

Match Matchid Teamid Playerid

Now I want a player name from the player table for player1 and player2 in Dropdown box

I am doing it for a college project using php codeigniter and stuck at this Please help me on this anyone.

Masuk Helal Anik
  • 2,155
  • 21
  • 29

1 Answers1

0

Your case looks like a simple JOIN query

SELECT T.team_id, P1.player_name, P2.player_name from team T JOIN player P1 ON T.player1 = P1.player_id JOIN player P2 ON T.player2 = P2.player_id
Aneesh Relan
  • 342
  • 3
  • 12