Welcome Guest, Not a member yet? Register   Sign In
Call to a member function num_rows() on a non-object
#11

[eluser]Zorancho[/eluser]
Try using this:
Code:
function compare($fid, $uid)
{
    $fid = (int) $fid;
    $uid = (int) $uid;
    $sql = "SELECT * FROM friends_list WHERE approved_status = 'yes' AND user_id=".$uid." AND friend_id=".$fid." OR
    (friend_id=".$uid." AND user_id=".$fid.") LIMIT 1";
    $q = $this->db->query($sql);
    if($q->num_rows() > 0)
    {
        return true;
    }
    return false;
}
It worked for me


Messages In This Thread
Call to a member function num_rows() on a non-object - by El Forum - 08-20-2009, 05:49 PM
Call to a member function num_rows() on a non-object - by El Forum - 08-21-2009, 05:57 AM
Call to a member function num_rows() on a non-object - by El Forum - 08-21-2009, 05:31 PM
Call to a member function num_rows() on a non-object - by El Forum - 08-21-2009, 08:10 PM
Call to a member function num_rows() on a non-object - by El Forum - 08-21-2009, 11:23 PM
Call to a member function num_rows() on a non-object - by El Forum - 08-21-2009, 11:42 PM
Call to a member function num_rows() on a non-object - by El Forum - 08-22-2009, 12:06 AM
Call to a member function num_rows() on a non-object - by El Forum - 08-22-2009, 08:58 PM
Call to a member function num_rows() on a non-object - by El Forum - 08-22-2009, 09:06 PM
Call to a member function num_rows() on a non-object - by El Forum - 09-05-2009, 01:04 PM
Call to a member function num_rows() on a non-object - by El Forum - 09-05-2009, 02:00 PM
Call to a member function num_rows() on a non-object - by El Forum - 09-05-2009, 02:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB