ID(PK), Name, Team, Pos
matchupID(PK), player1ID, player2ID
player1ID and 2 are FKs to Players.ID
I'd like to select the name of both players when pulling but cant get the query correct. I do NOT want a union here.
Something along the lines of this, I'm also open to a better suggestion for formatting the two tables I have.
$queryString = "SELECT Players.name FROM Players
INNER JOIN Matchup WHERE Players.ID = player1ID,
SELECT Players.name FROM Players
INNER JOIN Matchup WHERE Players.ID = player2ID";
You shoudl join two time Player and not matchup
$queryString = "select a.name, b.name from Matchup as c Inner Join Players as a on c.player1ID = a.ID Inner Join Players as b on c.player2ID = b.ID";