php - Display friend post according to the friend connected to each other? -
i have 2 tables in mysql frnd_request , nsm_post want show post according user share post primary school mate , secondary school mate etc.
frnd_request table referece column user connected each other. table structure below
1 id 2 user_id 3 frnd_id 4 status 5 referece (how friend connected each other primay, secondary school mate) 6 confirmation 7 note 8 date
nsm_post post table show_to field define friend group of logged in user can see post.
1 id 2 uid (user id of user posted post) 3 post 4 ip 5 show_to (to friend group post display) 6 img_video_name 7 date
select nsm_post.post frnd_request, nsm_post frnd_request.user_id = nsm_post.uid
this should work. guess trying restricting posts user's school mates. not possible current table structure. have setup additional table this:
primary | uid1 | uid2 | type
0 | 10004 | 10005 | school mate
Comments
Post a Comment