Re: Another HABTM self referencing question - cannot save data?

2007-09-29 Thread red
I think that I worked out better solution for this. The model relation: var $hasAndBelongsToMany = array( 'Friend' => array('className' => 'User', 'joinTable' => 'users_users',

Re: Another HABTM self referencing question - cannot save data?

2007-09-29 Thread red
On 29 Wrz, 12:23, AD7six <[EMAIL PROTECTED]> wrote: > ... which is by design, otherwise how could you (easily) delete an > association. There are a few posts/threads/bakery articles/etc. around > with "working with habtm" in the title, after a quick google I am sure > you will find the info you

Re: Another HABTM self referencing question - cannot save data?

2007-09-29 Thread AD7six
On Sep 29, 10:13 am, red <[EMAIL PROTECTED]> wrote: > It's a bit closer, but now I get in debug: > > SELECT COUNT(id) AS count FROM `users` WHERE `id` = 5 > SELECT COUNT(id) AS count FROM `users` WHERE `id` = 5 > UPDATE `users` SET `id` = 5 WHERE `id` IN (5) > DELETE FROM `users_users` WHERE use

Re: Another HABTM self referencing question - cannot save data?

2007-09-29 Thread red
It's a bit closer, but now I get in debug: SELECT COUNT(id) AS count FROM `users` WHERE `id` = 5 SELECT COUNT(id) AS count FROM `users` WHERE `id` = 5 UPDATE `users` SET `id` = 5 WHERE `id` IN (5) DELETE FROM `users_users` WHERE user_id = '5' INSERT INTO `users_users` (user_id,friend_id) VALUES (

Re: Another HABTM self referencing question - cannot save data?

2007-09-28 Thread AD7six
On Sep 28, 11:36 pm, red <[EMAIL PROTECTED]> wrote: > Hello everybody! > I want to make something similliar to friend list, so I used self > referencing HABTM - users_users. > > The tables are: > users (id, friend_id, bla bla bla) - pk (id, friend_id) // > and id of course == friend_id

Another HABTM self referencing question - cannot save data?

2007-09-28 Thread red
Hello everybody! I want to make something similliar to friend list, so I used self referencing HABTM - users_users. The tables are: users (id, friend_id, bla bla bla) - pk (id, friend_id) // and id of course == friend_id users_users (user_id, friend_id)- pk (user_id, friend_i

Re: HABTM self-referencing question

2007-07-31 Thread [EMAIL PROTECTED]
you have your var $hasAndBelongsToMany messed up. Should be something similar to the following: var $hasAndBelongsToMany = array( 'FlowFile' => array('className' => 'FlowFile', 'joinTable' => 'contacts_flow_files',

HABTM self-referencing question

2007-07-25 Thread matlin
This may have been answered already but the search is for some reason not working well for me. My HABTM looks like this: var $hasAndBelongsToMany = array('parameters' => array('className' => 'Wac', 'joinTable' => 'wacs_params',