Remove $this->create(). It is only for creating NEW records.
On Jan 8, 5:21 pm, Miles J <[email protected]> wrote:
> So I have this method that updates a row, but everytime it runs it
> keeps inserting records instead of updating. Ive tried using read() in
> place of $this->id, but that didnt work either.
>
> function block($id) {
> $this->create();
> $this->id = $id;
>
> $data = array();
> $data['Friend']['status'] = 'blocked';
> $data['Friend']['blockedTime'] = time();
>
> return $this->save($data, false);
> }
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---