You're setting which friends row to update in the table by the id:

 $this->id = $id;

So its going to use that id as the where clause.  The SQL you're
getting seems like desired behavior, maybe you don't have an id column
in you friends table?

Your table structure should always include an 'id' field set to integer
(11), primary, unsigned and auto-increment.



On Jan 8, 4:16 pm, Miles J <[email protected]> wrote:
> Hmmm, this finally runs an update:
>
>         function block($id) {
>                 $this->id = $id;
>
>                 $data = array();
>                 $data['Friend']['status'] = 'blocked';
>                 $data['Friend']['blockedTime'] = time();
>
>                 return $this->save($data, false);
>         }
>
> But no rows are affected by it, because its calling friends.id, ideas?
>
> UPDATE `friends` SET `status` = 'blocked', `blockedTime` = 1231456514
> WHERE `friends`.`id` = 23
--~--~---------~--~----~------------~-------~--~----~
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