I have the following tables:
platforms(id,platformname)
games(id,title,platformid)
gameslists(id,memberid,gameid)
I would like to select all records from the games table, but exclude records where games.gameid is present in gameslists for a specific member. So in plain English: select all records from the games table except for those where the gameid is present in gameslists table where the memberid equals 999 (memberid will come from the session). I also need the platform name, but I think that's a simple inner join.
I tried this, and other variations but to no avail!
SELECT DISTINCT games.id, platforms.platformname, gameslists.gameid
FROM games
INNER JOIN platforms ON games.platformid = platforms.id
INNER JOIN gameslists ON games.id = gameslists.gameid
WHERE platformid = 1 and gameslists.memberid <> 999
ORDER BY games.releasedate DESC
LIMIT 8