I'm trying to build a 'news feed' of sorts, and I'm having trouble writing up the query in order to do this!
The question in a nutshell, if User A goes to their home page and follows Users B, C, D - I'm trying to make it so that they see content from users B, C, D.
Assuming 2 tables: posts, connections
Where table posts
has lots of relevant columns, and table connections
has columns id,user,followed
In (terrible) pseudocode, I'm trying to do something like this:
SELECT * FROM posts WHERE author=(SELECT followed FROM connections WHERE user='A')
And it'd post stuff by B,C,D (aka who A follows)
By any chance would anyone know how to write this as an actual MySQL query? The stuff I've read already seems pretty confusing, and I don't really understand how I would go about doing this!
Thank you, very much! Any help is greatly appreciated! :)