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 Quote Link to comment Share on other sites More sharing options...
Psycho Posted October 17, 2013 Share Posted October 17, 2013 (edited) 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 Edited October 17, 2013 by Psycho Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.