SELECT t.ID FROM arch_article t LEFT JOIN arch_article_remap r ON t.ID = r.articleID WHERE ( LOWER(r.url) = 'reversals-earth's-magnetic-field-flood' OR LOWER(t.publishURL) = 'reversals-earth's-magnetic-field-flood' OR CONCAT(LOWER(r.url),'/') = 'reversals-earth's-magnetic-field-flood' OR CONCAT(LOWER(t.publishURL),'/') = 'reversals-earth's-magnetic-field-flood' OR LOWER(r.url) = CONCAT('reversals-earth's-magnetic-field-flood','/') OR LOWER(t.publishURL) = CONCAT('reversals-earth's-magnetic-field-flood','/') ) 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-magnetic-field-flood' OR LOWER(t.publishURL) = 'reversals-e' at line 1]: DB Error: syntax error