php - How to get values from two table with subqueries? -
i have 2 tables names feed, , friendship....
friendship table has these fields..toid session user id, fromid friend id, , status may 0 or 1, , feed table contains id,post_user_id feed poster id, , contents. want feed feed table friends able feeds friends can't own feed , when put own id in condition query executed result empty. tried these
select * feed `post_user_id` in (select fromid gr_user_friendships toid = 47) order post_date_time desc
/****this query giving friends records not mine records put own id in condition agains****/
select * feed `post_user_id` in (select fromid gr_user_friendships toid = 47) , `post_user_id` = 47 order post_date_time desc
/*this time results empty**/
i tried inner join no success @ all
try:
select * feed post_user_id = 47 or 'post_user_id' in (select fromid gr_user_friendships toid = 47) order post_date_time desc