Lucky2710 Posted July 30, 2010 Share Posted July 30, 2010 I have 4 tables "a users table" "a teams table" "a games table" and "a picks table" Tables are set up like this... Games Teams Picks Users - ID - ID - ID - id - Week - Team - User_ID - full_name - Away - Game_ID - user_name - Home - Pick - password My issue is getting the data from the multiple tables at one time. Like i need to pull from teams the team name into games (away and home) each team has a different id and in the games table in the way spot is that teams id. so how do u pull the team name depending on what is in the away field. If i can figure that out i can figure the rest out on my own. but i dont have a clue how to do that major starting place. My plan is to use php to echo the data onto the page. Thanks for any help i can get! Server version is 5.1.42 Client Version is 5.1.37 Apache/2.0.52 (Red Hat) Quote Link to comment https://forums.phpfreaks.com/topic/209294-using-data-in-multiple-tables-in-1-database/ Share on other sites More sharing options...
Lucky2710 Posted July 30, 2010 Author Share Posted July 30, 2010 $result1 = mysql_query("SELECT CollegeFootballGames.ID, CollegeFootballGames.Week, CollegeFootballGames.Away, CollegeFootballGames.Home, CollegeFootballTeams.Team FROM CollegeFootballGames INNER JOIN CollegeFootballTeams ON CollegeFootballGames.Away = CollegeFootballTeams.ID || CollegeFootballGames.Home=CollegeFootballTeams.ID"); while ($row = mysql_fetch_object($result1)) { $GameID[] = $row->ID; $Teams[] = $row->Team; Quote Link to comment https://forums.phpfreaks.com/topic/209294-using-data-in-multiple-tables-in-1-database/#findComment-1092879 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.