left join with extra conditions
I'm trying to setup a rating app for images. I want to display the images that haven't been rated by the current logged user.
This covers two tables, I've successfully joined the tables but the extra conditions:
1. must be an image
2. exclude any images that have already been rated by the current user
are not working.
Its displaying the results as if the 2 AND conditions aren't there at all.
SELECT ver_data_media.id, ver_data_media.value, ver_data_media.ref, ver_data_media.type, ver_data_rating.a
LEFT JOIN ver_data_rating
ON ver_data_media.ref = ver_data_rating.a
AND ver_data_media.type = 'image'
AND ver_data_rating.a != $current_user->ID
Any advice would be greatly appreciated, thanks Frank.