$sql_category it's just the result of php foreach that returns the possible categories, and $sql_country is the country code of the visitor.
SELECT camp_id, url FROM run_camps WHERE served < total AND (' . $sql_category . ' OR target_categories = "") AND ((target_countries LIKE "%' . $sql_country . '%") OR target_countries = "") ORDER BY last_click ASC LIMIT 1
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.