You're right, I am sorry, what I said makes no sense...
What I meant to say before I confused myself and a bunch of other people is that... This is so hard to make sense of it I don't even know how to explain it anymore...
reviews2_reviews.id_category = reviews2_countries.id
will always be a match
reviews2_reviews.id_category = reviews2_category.id
will also always be a match
what I need is this:
if reviews2_reviews.id_category = reviews2_countries.id then
then I want the data
UNLESS
( reviews2_reviews.id_category = reviews2_category.id && category LIKE "music%" category LIKE "book%" category LIKE "magazine_%" )
Even better, please take a look at the attached file and think of it this way:
Mary is assigned reviews2_reviews.id=1 and is assigned to reviews2_reviews.id_category=2 which means she will be filed under the category with reviews2_category.id=2, which is reviews2_category.category="music_else".
In much the same way Robert is assigned reviews2_reviews.id=2 and is assigned to reviews2_reviews.id_category=6 which means he will be filed under the category with reviews2_category.id=6, which is reviews2_category.category="magazine_2".
and so on...
in my PHP code I have a variable $c carrying a numerical value that sometimes represents the reviews2_category.id and other times represents the value of reviews2_countries.id
I want to pull a list from the database that will have ALL the names whose $c value is a value of reviews2_countries.id
To do that in the SQL query I have to use WHERE to match reviews2_reviews.id_category to reviews2_countries.id
hence:
reviews2_reviews.id_category = reviews2_countries.id
Unfortunately I cannot stop here because that will also show me all the names of the people whose $c value is not the value of a country but is the value of a category.
To eliminate those people from the list I have to first match reviews2_reviews.id_category to reviews2_category.id
hence:
reviews2_reviews.id_category = reviews2_category.id
and after I have done that IF (and here is why I thought I need an IF) the "category" value associated in reviews2_category.id contains the text strings "music" or "book" or "magazine_" then I know that I can trash that value...
I hope that makes more sense... The more I talk about it the less sense it makes to me...