Friday, July 3, 2009

Re: Save method not working,working only on inserts

$this->data['Resource']['ID']=1000;

should be:

$this->data['Resource']['id']=1000;

(Models are CapitalisedNoSpaces, fields are all lowercase_underscore)

On Jul 3, 6:03 am, sajjan <sajjan.sar...@gmail.com> wrote:
> Thank you Miles!
>
> Hmm.. I had tried this and it did not work,but if I put both the lines
> below together it is working.
>
> $this->data['Resource']['ID']=1000;
> $this->Resource->id = 1000;
>
> If I remove any of these the update fails.
> Thanks so much guys!
>
> On Jul 2, 8:39 pm, Miles J <mileswjohn...@gmail.com> wrote:
>
>
>
> > $this->Resource->id = 1000;
> > $this->Resource->save()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: