I'm trying to save a has and belongs to many association.
I have a self associated table
My table structure is:

users
   id
   name

users_users
   user_id
   friend_id

In the association table the user_id is the owner of the relationship
and the friend_id is the friend of that user.

I'm trying to save an association between two users that already
exist. I'm not using forms, I'm passing in arguments and I can't seem
to figure this out.

My code:

$this->data['User']['User'][0] = $friend_id;
$this->data['User']['id'] = $user_id;
$this->User->save($this->data);


All of the tutorials/examples I've seen are based on creating the
related item at the same time. What am I doing wrong?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to