dsbpac Posted October 16, 2013 Share Posted October 16, 2013 I have a db wiith the following fields userid, postuserid, info users post information as follows userid 2 posteruserid 6 info blah blah blah The postuserid is the id number of the person that is logged in and posting an article. Userid is the users profile they are posting to. I'm having an issue figuring out how to display [sOMETHING] only if the user logged in has not posted on that users profile. Any help is appreciated. Thank you Link to comment https://forums.phpfreaks.com/topic/283034-comparing-help/ Share on other sites More sharing options...
Psycho Posted October 17, 2013 Share Posted October 17, 2013 I would assume you also have a users table, correct? SELECT * FROM users WHERE userid NOT IN ( SELECT userid FROM posts WHERE postuserid = $loggedInUserID ) EDIT: Moving to MySQL forum Link to comment https://forums.phpfreaks.com/topic/283034-comparing-help/#findComment-1454208 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.