MySQL Forums
Forum List  »  Newbie

basic question about relational databases
Posted by: danicgross danicgross
Date: February 26, 2009 10:45AM

Hi -

I'm currently designing a messaging system for a website.
The current outline I have is this:
table: USER_KEYS
-uid //user id
-incoming_keys //FK's for all messages user has, references to PK in "incoming"
-outgoing_keys //FK's for all messages user has, references to PK in "outgoing"

incoming table:
-mid //message id, auto increment
-text //message text
-of course other things like read/unread ect..

same for outgoing.

my question is - firstly, am i doing this right?
second - if i am, can i have multiple foreign keys in one field? For example:
uid: 4, incoming_keys: 2021, 503, 34243, 2340.
will mysql recognize this?

thanks.

Options: ReplyQuote


Subject
Written By
Posted
basic question about relational databases
February 26, 2009 10:45AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.