in my Application (Image Voting) I have several Roles for User, Voter & Admin.
The Select for the User looks like this:
SELECT * from wp_awa_upload, category, subcategory
WHERE wp_awa_upload.uid = '$_SESSION[id]'
AND wp_awa_upload.parent_cat = category.cat_id
AND wp_awa_upload.sub_cat = subcategory.id
A user can just see his own Images, but a Voter should see all the images on which he had not voted. When a Voter is voting, there will be a new entry into table "wp_awa_session" with the ID of the Uploaded Image and his own ID. So the Select above has to be adopted with a "and where the Session_ID and the Uploaded ID are not in table wp_awa_session" condition.
How can I achieve this?