I think that I worked out better solution for this.
The model relation:
var $hasAndBelongsToMany = array(
'Friend' =>
array('className' => 'User',
'joinTable' => 'users_users',
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
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
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 (
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
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
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',
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',