fenway Posted July 6, 2008 Share Posted July 6, 2008 This will return all the members who aren't already friend-ed: select friendid from members as m left join added as a on ( a.theirs = m.friendid ) where a.theirs is null Obviously, you'll need to limit it the current member.... Quote Link to comment Share on other sites More sharing options...
acidglitter Posted July 13, 2008 Author Share Posted July 13, 2008 okay this is what i have now. nothing will show up when a.yours is there. but i'm not sure of how else to do it. because if it just said a.theirs IS NULL then every member would only get added once. i need it to select members that haven't been added by the member thats currently logged in. SELECT friendid FROM members AS m LEFT JOIN added AS a ON (a.theirs = m.friendid) WHERE a.yours='$friendid' AND a.theirs IS NULL Quote Link to comment Share on other sites More sharing options...
corbin Posted July 13, 2008 Share Posted July 13, 2008 Try doing m.friendid = $friendid. But, I'm no positive I understand your table schema correctly, so I could be way off. Quote Link to comment Share on other sites More sharing options...
fenway Posted July 14, 2008 Share Posted July 14, 2008 Then: SELECT friendid FROM members AS m LEFT JOIN added AS a ON (a.theirs = m.friendid AND a.yours='$friendid' ) WHERE a.theirs IS NULL 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.