SELECT t.ID FROM arch_article t LEFT JOIN arch_article_remap r ON t.ID = r.articleID WHERE ( LOWER(r.url) = 'mendel's-accountant-genetics-natural-selection' OR LOWER(t.publishURL) = 'mendel's-accountant-genetics-natural-selection' OR CONCAT(LOWER(r.url),'/') = 'mendel's-accountant-genetics-natural-selection' OR CONCAT(LOWER(t.publishURL),'/') = 'mendel's-accountant-genetics-natural-selection' OR LOWER(r.url) = CONCAT('mendel's-accountant-genetics-natural-selection','/') OR LOWER(t.publishURL) = CONCAT('mendel's-accountant-genetics-natural-selection','/') ) AND visible <> 'f' LIMIT 1 [nativecode=1064 ** 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 's-accountant-genetics-natural-selection' OR LOWER(t.publishURL) = ' at line 1]: DB Error: syntax error