I am trying to get the posts from the users the current user is following. And also the post owners username and avatar. My tables look like this
Users table
User Id | Username | Avatar
Posts Table
post_id | user_id | body | image
Follows Table
leaders_id | followers_id
Here i s my current query
query = "SELECT *
FROM posts
WHERE $user_id IN(
SELECT leader_id
FROM follows
WHERE follower_id=$user_id)
ORDER BY date DESC
LIMIT 10";