Quantcast
Channel: Active questions tagged feed - Stack Overflow
Viewing all articles
Browse latest Browse all 542

Return The Records Of Myself And Other Users?

$
0
0

I have this query. It works but it is not returning records for the logged in user, only the users they follow. I want it to do both: return the users own posts plus people they follow on the site

(the code below just duplicates the logged in users own posts)

$FetchFollowing = $db->fetchAll("SELECT  xf_social_feeds.*, xf_user_follow.*     FROM xf_user_follow   JOIN xf_social_feeds     ON xf_user_follow.follow_user_id = xf_social_feeds.user_id_feeds    WHERE xf_user_follow.user_id = '$uid'      OR xf_social_feeds.user_id_feeds = '$uid'    ORDER by id DESC LIMIT $DefaultLoadLimit");

I could just put the user in the followers table when they register but i'm hoping to try to find a better solution first even if i have to ask on here


Viewing all articles
Browse latest Browse all 542

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>