Results 1 to 8 of 8
Thread: Multiple print_r columns? Why?
Mar 26, 2011, 20:52 #1
Multiple print_r columns? Why?
I have this query:
SELECT DISTINCT g.home_id, g.guest_id, sp.sport, sp.id, st.state, st.id, th.school, tg.school FROM ws_games as g JOIN ws_teams as th ON g.home_id = th.id JOIN ws_teams as tg ON g.guest_id = tg.id JOIN ws_state as st ON st.id = g.state JOIN ws_sport as sp ON sp.id = g.sport WHERE g.sport = $sport AND g.year = $year AND g.state = $state AND g.week = $week
Array (  => 18 [home_id] => 18  => 19 [guest_id] => 19  => Football [sport] => Football  => 1 [id] => 4  => Hawaii [state] => Hawaii  => 4  => Oceanfront [school] => Spring Beach  => Spring Beach )
ID: 1, home_id: 18, guest_id: 19, state: 4, sport: 1
And why does  Oceanfront not have its own [school] like Spring Beach?
This makes me have to use $row to print out Oceanfront and $row["school"] or $row to print out Spring Beach.
Could someone help me understand this, please?
I can get by using the numbers like they are, but is there a way to give each school a different key that is more useful than a number?