how to do select more then 3 table add in select IN() function SELECT M.post_id, M.uid_fk, M.message, M.image1,M.roles, M.created,U.uname, U.f_name, U.l_name
 FROM posts M, person U
 WHERE M.uid_fk=U.p_id
    AND M.uid_fk in (
      (select send_id from friend_request where p_id = '7' AND status=1)
        or
     (select p_id from friend_request where send_id = '7' AND status=1) 
        AND
     (select send_id from follower_request where p_id = '7' AND status=1 AND M.uid_fk = '7')
        AND 
     M.uid_fk = 7
  )
 order by M.post_id DESC


and made by i can't got current data.

how to i get like this query

SELECT M.post_id, M.uid_fk, M.message, M.image1,M.roles, M.created,U.uname, U.f_name, U.l_name
 FROM posts M, person U
 WHERE M.uid_fk=U.p_id
  AND M.uid_fk in (1,2,3,4,7,8,9)
 order by M.post_id DESC
Hope It will Help.

SELECT M.post_id, M.uid_fk, M.message, M.image1,M.roles, M.created,U.uname, U.f_name, U.l_name
 FROM posts M, person U
 WHERE M.uid_fk=U.p_id
    AND M.uid_fk in ( SELECT id FROM (
      (select send_id as id from friend_request where p_id = '7' AND status=1)
        UNION ALL
     (select p_id as id from friend_request where send_id = '7' AND status=1) 
        UNION ALL
     (select send_id as id from follower_request where p_id = '7' AND status=1) 
 ) as ids

  ) AND M.uid_fk = 7
 order by M.post_id DESC