jkewlo Posted April 20, 2009 Share Posted April 20, 2009 Hey cant seem to figure this out! I have users, following, and post all different tables It's kinda like Twitter I have users that can Follow other users but I need to get the users post that he/she is following Following Table user_id follower_id Users Table id Post Table id user_id I need to inner join the three tables so that user_id can get the followers post if you goto http://www.eve-lounge.com I just need to get the post from the users someone is following. Link to comment https://forums.phpfreaks.com/topic/154911-inner-join-on-3-tables/ Share on other sites More sharing options...
jkewlo Posted April 21, 2009 Author Share Posted April 21, 2009 no one can help me? Link to comment https://forums.phpfreaks.com/topic/154911-inner-join-on-3-tables/#findComment-815556 Share on other sites More sharing options...
Maq Posted April 21, 2009 Share Posted April 21, 2009 Don't double post especially in two separate sections, please read my response in your other post. http://www.phpfreaks.com/forums/index.php/topic,248975.msg1166066.html#msg1166066 Link to comment https://forums.phpfreaks.com/topic/154911-inner-join-on-3-tables/#findComment-815568 Share on other sites More sharing options...
Mchl Posted April 21, 2009 Share Posted April 21, 2009 If you don't get answers to your question this is usually for one of these two reasons. 1. Noone knows the answer 2. Your question is not clear enough Posting it again in other section is unlikely to help (and likely to annoy people) Now to your question. You really should give us some example of a result you would like to get... that would help How about this: SELECT p.id FROM postTable AS p INNER JOIN followTable AS f ON (p.user_id = f.follower_id) WHERE f.user_id = ? Link to comment https://forums.phpfreaks.com/topic/154911-inner-join-on-3-tables/#findComment-815571 Share on other sites More sharing options...
Recommended Posts