PHP/MYSQL dynamic query
Posted: Mon May 25, 2009 12:27 pm
Hello all. TY in advance for any help/suggestions. I'm trying to do a dynamic php mysql search. This doesn't seem to work, so I was wondering where I went wrong.
The $week variable is calculated to select a certain week only (eg: 1 or 2, etc). There is a column in the db for game_week.
What I'm trying to do is select from two different tables.
1) From schedule09 I need game_(date, park, vis, home, week)
2) From scores09 I need game_(vis1, home1, vis2, home2, status1, status2).
They are foreign linked by a game_id column.
TY
Code: Select all
$query = "SELECT game_date, game_park, game_vis, game_home, game_vis1, game_home1, game_vis2, game_home2, game_status1, game_status2 FROM schedule09 RIGHT JOIN scores09 ON schedule09.game_id= scores09.game_id WHERE game_week = $week order by schedule09.game_date";What I'm trying to do is select from two different tables.
1) From schedule09 I need game_(date, park, vis, home, week)
2) From scores09 I need game_(vis1, home1, vis2, home2, status1, status2).
They are foreign linked by a game_id column.
TY