Forum Moderators: open
I'm try to structure my query to allow for an or statement.
Original Query (Works)
$query=mysql_query("SELECT * FROM table WHERE url LIKE 'http://www.domain1.com%' AND requirements='met'");
Query with attempted OR Statements (Doesn't Work)
$query=mysql_query("SELECT * FROM table WHERE url LIKE 'http://www.domain1.com%' OR WHERE url LIKE 'http://www.domain2.com%' AND requirements='met'");
$query=mysql_query("SELECT * FROM table WHERE url LIKE ('http://www.domain1.com%' OR 'http://www.domain2.com%') AND requirements='met'");
$query=mysql_query("SELECT * FROM table WHERE url LIKE ('http://www.domain1.com%' ¦¦ 'http://www.domain2.com%') AND requirements='met'");
I tried searching for it, but the search engines don't like searching by OR.
Also, besides just using an OR, is there a better way to structure this? Eventually I would like to make the query run if one of ten urls are matched, but the number might grow in the future.
Now I'm concerned. If I have a long list of domains, the query is going to get huge. Will this cause some time of performance issue? Is there a way for me to make the list more managable, if nothing else than just for me looking at the code trying to edit it in the future?