Friday, January 2, 2009

Re: Selecting users who are not friends

On Fri, Jan 2, 2009 at 10:53 PM, Webweave <webweave@gmail.com> wrote:
>
> First, you should reall be using find('all') not findAll, as in:
>
> $friends = $this->User-find('all', array('conditions' => array
> ('User.id' => $target)));
>
> To find all the users who are not friends, simply use the following:
>
> $notFriends = $this->User-find('all', array('conditions' => array
> ('NOT' => array('User.id' => $target))));


That won't grab users who have no friends.


--
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )

--~--~---------~--~----~------------~-------~--~----~
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: