I am creating a fantasy football android app where getting the JSON data is done with php files and SQL. My problem involves 2 tables:
player_details
- player_id (primary key)
- first_name
- last_name
user_team (All id fields except PK are foreign keys linked to the player_id)
- user_team_id (primary key)
- goalkeeper_id
- rightback_id
- leftback_id
- etc.
I want to be able to run a PHP script, with a simple select statement in it, that will display a user team's details. I also want to include the first and last name of the players, which are linked to the foreign keys in the user_team position id fields. However all I can do is display the user_teams details and the players_id only.
SELECT *
FROM user_team
WHERE user_id = '".$uid."'