Simply query question...
Posted: Sun Feb 15, 2009 11:51 pm
I need to do a query which will pull all the records from the table "players" and display the records by echoing.
The only issue is, when I do the query on the table "players" it is giving me all the correct data except I get the ID values from foreign tables that have relationships to "players". I think I need to use a Join statement but Im not sure how to do this...
Right now my query is this:
This is what I get for results...
http://www.postimage.org/image.php?v=aV22pEbJ
Where I get the ID numbers for the fields it references to, i would like the actual value to be displayed...
Ex:
Table: teams Table: positions
ID Team ID Position
1 Bruins 1 Forward
2 Canadiens 2 Defense
3 Rangers 3 F/D
4 Red Wings 4 Goalie
So I want to see... Michael Ansaldi - Red Wings - Forward etc...
Any help would be great! Thank you
The only issue is, when I do the query on the table "players" it is giving me all the correct data except I get the ID values from foreign tables that have relationships to "players". I think I need to use a Join statement but Im not sure how to do this...
Right now my query is this:
Code: Select all
SELECT * FROM playersWhere I get the ID numbers for the fields it references to, i would like the actual value to be displayed...
Ex:
Table: teams Table: positions
ID Team ID Position
1 Bruins 1 Forward
2 Canadiens 2 Defense
3 Rangers 3 F/D
4 Red Wings 4 Goalie
So I want to see... Michael Ansaldi - Red Wings - Forward etc...
Any help would be great! Thank you