Re: two foreign keys referencing the same field in the same table

2007-04-14 Thread erdbeerelse
Oh thank you! The association solved it! On Apr 9, 6:37 pm, "soytuny" <[EMAIL PROTECTED]> wrote: > In a project I'm working on, I have a messages table as well. In the > message.php I have the following association > > var $belongsTo = array( > 'Recipient' => > array('className' =>

Re: two foreign keys referencing the same field in the same table

2007-04-09 Thread soytuny
In a project I'm working on, I have a messages table as well. In the message.php I have the following association var $belongsTo = array( 'Recipient' => array('className' => 'User', 'foreignKey' => 'recipient_id', ), 'Sender' => array('cla

two foreign keys referencing the same field in the same table

2007-04-09 Thread erdbeerelse
hello, I have a question about naming convention with foreign keys. in my first table (users) I have a primary key id, which is the user id followed by username, useradress in my second table (msgs) I save messages from a user to a user. So I want to reference the foreigns keys fromuser and t