I need help with SQL and PHP. What I have in my SQL database is this:
Posts
text | by| post_id
Post 1 [...] | 2 | 1
Post 2 [...] | 3 | 2
Post 3 [...] | 6 | 3
Post 5 [...] | 8 | 4
Post 6 [...] | 9 | 5
Following
to | by
2 | 1
3 | 1
6 | 1
In the table above you can see that you are user “1” and what I want to do is to list the table “posts” and since I follow user 2, 3 and 6 as you can see in the table “following” I want to show them and if I add another line in following where I start to follow user 8. I also want to show his post. How to I do it?
1 Answer