$line = @mysql_query("SELECT * FROM clips, userclips
WHERE userclips.userid='$id' AND
userclips.clipid=clips.id ORDER BY clips.title");
Which returns all the clips associated with a particular user. However I’m stumped trying to write a query that will do the exact opposite; select all clips that aren’t associated with that user.
I have tried this:
$line = @mysql_query("SELECT DISTINCT * FROM clips, userclips
WHERE userclips.userid!='$id' AND userclips.clipid=clips.id ORDER BY clips.title");
Which does return clips not associated with that user, however it misses clips that aren’t associated with any users.
Please help if you can 🙂
1 Answer