Okay, i went with you solution, I guess it will be about the same,
although the composite primary key was kind of nice :-)
Thanks to everybody answering

On 7 Jul., 14:29, James K <[EMAIL PROTECTED]> wrote:
> CakePHP does not support composite primary keys. You need to add
> another column to your table called id and make that the primary key.
> To ensure this doesn't break your database, you can add a unique
> constraint to user_id and group_id at the database level. Kinda sucks,
> but it's the only option unless you want to hand-write your own update
> and delete queries.
>
> On Jul 7, 3:38 am, zpon <[EMAIL PROTECTED]> wrote:
>
> > Hello
>
> > I have a sql table which only contains two field (user_id and
> > group_id), these fields also makes up a primary key, but whenever I
> > try to delete from the table (del(array('user_id' => $this->data...,
> > 'group_id' => $this->data...)) I get the following error:
>
> > SELECT COUNT(*) AS `count` FROM `users_groups` AS `UsersGroups` WHERE
> > `UsersGroups`.`id` = 'users_groups.user_id'
>
> > I have tried to set the primaryKey in the model to the two correct
> > fields, but that didn't help.
>
> > What am I doing wrong? Thanks in advance
>
> > ps. I have also set belongsTo:
> > var $belongsTo = array(
> >         'Groups' => array(
> >                 'className' => 'Groups',
> >                 'foreignKey' => 'group_id'),
> >         'User' => array(
> >                 'className' => 'User',
> >                 'foreignKey' => 'user_id'));

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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