Simply query question...

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
longshoremoney
Forum Newbie
Posts: 3
Joined: Sun Feb 15, 2009 11:33 pm

Simply query question...

Post by longshoremoney »

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:

Code: Select all

SELECT * FROM players
This is what I get for results...
Image 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 :D
Post Reply