Error!

MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$(this).attr(") or (url = "whole-site")) ORDER BY priority desc' at line 1SQL Statement: SELECT distinct web_ads.id,location,code,type FROM web_ads JOIN web_ad_pages as p on p.ad_id=web_ads.id join web_ad_dates as d on d.ad_id=web_ads.id and d.start_date <= '2019-09-15' and d.end_date >= '2019-09-15' WHERE web_ads.magazine_id='13' and ((url = "/knowledge-center/application/automotive") or (url = "/knowledge-center/application/automotive/" $(this).attr(") or (url = "whole-site")) ORDER BY priority desc