Jump to content


Photo

Two primary keys with a foreign key?


  • Please log in to reply
1 reply to this topic

#1 skyace888

skyace888
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 19 September 2006 - 08:08 PM

I am trying to implement the model I designed at http://education.alc...odel9-19-06.gif using PHPMyAdmin.  I am having trouble getting the "PLAYERS" table right.  I need to have two primary keys and "TeamNumber" needs to be a foreign key that references TEAM -> Number.  Can this be done?  If so, how?

Thanks,
Al

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 20 September 2006 - 09:59 AM

There's no reason that your PK can't span multiple columns, if that's what you mean.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users