I am having problem with these result. I have been trying but no luck.
jobs table
id, title ... all details
1, title1,...
2, title2,...
3, title3,...
4, title4,...
job_user table
id,id_job,id_user
1,1,1
2,2,3
3,3,3
4,4,4
following_job table
id,id_job,id_user
1, 1, 3
So basically, user 3 has 2 jobs (2,3), and he follows job 1 of user 1. so, if i login as user 3, i would like to get all details jobs of user <> 3 (just the requirement that i need to do). i would get the result
id,id_job,id_user
1,1,1
4,4,4
My goal results would be :
id,title..., following_id
1,title1,...,1
4,title4,...,0
the following_id will be added as result above, since user 3 followed id_job 1 so its following_id = 1 else = 0. And id_job 1,4 will joined with jobs table to get details about it : title ...
I am doing the follow/unfollow job functionality
Thanks all