I have a table posts where all the posts by users are stored, the structure of this table is as follows.
| post_id | post_user | post_content | post_date |
The users table is as follows.
| user_id | username | user_joined |
User relationship table is as follows.
| follower | following | rel_date |
This is the query I am using to get the posts from people that user is following to show them.
SELECT * FROM posts
WHERE post_user in (
SELECT follower
from user_follow
where following=$loggedin_user)
Now I want users to share posts, for which I created a table repost_user as follows.
| repost_user | original_post_user | post_id | repost_date |