PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$alert = "SELECT id, email, first_name, last_name, lead_alert FROM members WHERE
(location LIKE '%".$country."%' OR location='All')
AND (industry LIKE '%".$industry."%' OR industry='All')";
$a_sql = mysql_query($alert)
or die ("Could not select matching members");
No matter how many times I scratch my head I can't figure it out. the fields specified (industry and location) contain more than one word of text. I don't think this has anything to do with the problem since LIKE uses patter matching, but just thought I would ask.
I am pretty sure it has something to do with how I am using the 'OR' statement combined with AND. Any help is appreciated.
$alert = "SELECT id, email, first_name, last_name, lead_alert FROM members WHERE
(location LIKE '%".$country."%' OR industry LIKE '%".$industry."%')
OR (location='All' AND industry='All')";
thanks, but that statement would not meet the required parameters as a user would be selected if either his location or industry matched. The requirements are for both to match. Think I got i licked thought. thanks