what kind of PHP operation am i looking for when i am trying to do something like this:
I have a player table, and a location table. Each player is unique, each location is unique, therefore having an auto_increment( id and lid) field in each table to give each player and location a unique identifier. Each location can be associated with a player. I am inserting the auto_increment field from the players table(id), into the player ID field of the locations table(pid). My question is, when i have multiple locations associated with a single player, how do store the results of a query that is finding many rows in the locations database, into an array that i can then display.
here is my query which displays all players and their associated locations
I have a player table, and a location table. Each player is unique, each location is unique, therefore having an auto_increment( id and lid) field in each table to give each player and location a unique identifier. Each location can be associated with a player. I am inserting the auto_increment field from the players table(id), into the player ID field of the locations table(pid). My question is, when i have multiple locations associated with a single player, how do store the results of a query that is finding many rows in the locations database, into an array that i can then display.
here is my query which displays all players and their associated locations
Code:
SELECT players.*, locations.* FROM players LEFT JOIN locations ON players.id = locations.pid
Comment