I think the best is an example of some output I'm trying to get, then list the tables and then my sql statment so far.
What happens. A manager of a team logs in, he needs to record the score of the game. So in his user table he has the team that he is associated with. He logs in he is presened with a dropdown prefilled with all games that have his team playing in it, and he must select what game he is recording the score for. The expected output is this Mets .vs Braves - 4/01/02 @ Downs Field, this data is grabbed from 3 tables. games, teams, and _fields. Here are those three tables.
games
gameid gamenum gamedate homescore visitorscore homeid visitorid fieldid
1 1 2002-04-01 10:00:00 NULL NULL 3 2 1
2 2 2002-04-01 10:00:00 NULL NULL 4 1 2
3 3 2002-04-01 13:00:00 NULL NULL 5 6 1
4 4 2002-04-01 13:00:00 NULL NULL 7 8 2
5 5 2002-04-02 19:00:00 NULL NULL 6 3 1
teams
id teamname division
1 Astros C
2 Braves A
3 Mets A
4 Orioles C
5 Expos M
6 Cardinals M
7 Cardinals C
8 White Sox C
_fields
id fieldname
1 Downs
2 LBJ
here is the SQL that I have worked on. I could be wayyyyyy off, but any help would be appreciated. "SELECT * FROM games LEFT JOIN teams ON (games.homeid=teams.id) AND ON (games.visitorid=teams.id) LEFT JOIN fields ON (games.fieldid=fields.id) WHERE games.homeid = '$TeamID' OR games.visitorid = '$TeamID'";
$TeamID is a session variable that is pulled from his user profile.