Thanks for the advice.
It finally worked with:
var $primaryKey = "user_id"; // Key not key


On 6 Jan., 18:49, "Andras Kende" <[email protected]> wrote:
> Hello
>
> try this:
>
> Contrioller
> $this->User->id = 1;
> $this->User->saveField("active",0);
>
> Model
> var $primarykey = "user_id"
>
> Andras
>
> On Tue, Jan 6, 2009 at 11:55 AM, ohneworte 
> <[email protected]>wrote:
>
>
>
> > Hello together,
>
> > I have a little Convention Problem, here a sample code - I want to
> > update a single field in the User model:
>
> > $this->User->id = 1;
> > $this->User->saveField("active",0);
>
> > How do I have to change this code if the primary key of my User model
> > is not "id" but "user_id". I already tried:
>
> > $this->User->userId = 1;
> > $this->User->saveField("active",0);
>
> > But this causes the insertion of a new row in my User table.
> > What have I forgotten? Thanks for any help!

--~--~---------~--~----~------------~-------~--~----~
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