Thanks cricket,

the extra find is because I find the record based on the userid, which
is not the same as the record id.  E.g. the record with userid 7 could
be record 1.

I do have $this->find(), sorry, must have mistyped again.  Anyway,
it's definitely finding it ok, and the line

$this->delete($friend['Friend']['id']);

is definitely being passed a valid id of an existing Friend record,
and still won't delete.

Thanks,
Sharon



On Jun 11, 10:19 am, cricket <[email protected]> wrote:
> On Jun 10, 3:35 pm, WhyNotSmile <[email protected]> wrote:
>
> > Oh, sorry, yes... $friendsarray gets processed; if it's null then the
> > userid is used to find the record which should be deleted.
>
> > So it's:
>
> > if(!$friendsarray) {
> >  $friend = $this->Friend->findByUserId($userid);
> >  $this->delete($friend['Friend']['id']);
>
> Actually, why aren't you simply doing $this->delete($userid)? Why do
> the extra find? In any case, it should be $this->find(), not $this-
>
> >Friend->find()

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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