Show Mini-Blogs From Me and Friends Only

Myfneyuog

New Member
I'm trying to make an MySQL query that will display mini-blogs from Me and My friends. Just like Twitter.Here are my tables;\[code\]--membersm_id INTm_user VARCHAR(rest are other member info)--shoutss_id INTs_userid INTs_content TEXTs_posted DATETIME--friendsf_userid INTf_friendid INTf_status INT // 0=pending, 1=approvedf_create DATETIMEf_update DATETIME\[/code\]Note: there are 2 entries for 1 friendshipex: f_userid = ME, f_friendid = MYFRIEND and is vice-versaf_userid = MYFRIEND, f_friendid = METhe code that works, but doesn't use the friendlist table is;\[code\]SELECT * FROM shouts JOIN members ON members.m_id = shouts.s_uid ORDER BY s_posted DESC\[/code\]having trouble adding in the friends table info.I believe i'm just missing one line of code or 2...I've tried this, but failed.\[code\]SELECT * FROM shouts JOIN members ON members.m_id = shouts.s_uid JOIN friendsON friends.f_friendid = members.m_idWHERE m_id = 1 //my idAND f_userid = 1 //my idAND f_status = 1ORDER BY s_posted DESC\[/code\]
 
Top