devilinc Posted July 9, 2010 Share Posted July 9, 2010 i have two tables here. one field say x of first table stores team names say denver broncos,green bay packers. now i have another table y, which has home team column as foreign key which points to x table and away team column also as foreign key which also points to same table 'X'. actually it just has to retreive team name from this x table and depending on if this team name exists in hometeam col or awayteam columnĀ give a result of home or away for different matches. so is this type possible? Quote Link to comment https://forums.phpfreaks.com/topic/207247-can-there-be-2-foreign-keys-for-a-single-field-of-a-table/ Share on other sites More sharing options...
Mchl Posted July 9, 2010 Share Posted July 9, 2010 I can't see why not. Quote Link to comment https://forums.phpfreaks.com/topic/207247-can-there-be-2-foreign-keys-for-a-single-field-of-a-table/#findComment-1083561 Share on other sites More sharing options...
devilinc Posted July 9, 2010 Author Share Posted July 9, 2010 so should i have a hometeam table and awaya team table which has just one field which are the team names. but this makes for two tables having same data and that's redundant right? Quote Link to comment https://forums.phpfreaks.com/topic/207247-can-there-be-2-foreign-keys-for-a-single-field-of-a-table/#findComment-1083564 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.