first as I understand you, you want to update a row with the specific $id so
to do this you don't need [ $this->create(); ]
you just need to
function block($id) {
$data = array();
$data['Friend']['id']=$id;
$data['Friend']['status'] = 'blocked';
$data['Friend']['blockedTime'] = time();
return $this->save($data, false);
}
On Thu, Jan 8, 2009 at 1:21 AM, 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
-~----------~----~----~----~------~----~------~--~---