(1-1/1)
Try
$friends = Friend::find(
'all',
array(
'conditions' => array('(user_id = ? OR receiver_id = ? ) AND is_pending = ?', $theUserID, $theReceiverID, $isPending);
)
);
(1-1/1)
June 27 2010
August 1, 2012
Subject: How to I write this sql?
I want to get results where requester_id = $this->user_id or receiver_id = $this->user_id and is_pending = 1;
I tried this:
$friends = Friend::find_all_by_requester_id_or_receiver_id_and_is_pending($this->user_id, $this->user_id, 1);
But I don't get the results I want.