SELECT IF(p.fullurl='' OR p.fullurl IS NULL, CONCAT('/',p.url),p.fullurl) AS pageurl FROM urlhistory AS h INNER JOIN pages AS p ON p.id=h.page_id WHERE p.site_id='3' AND p.deleted=0 AND p.published=1 AND (h.url='/Notre savoir-faire/Exercice de simulation d'urgence environnementale' OR h.url='Notre savoir-faire/Exercice de simulation d'urgence environnementale') ORDER BY h.id DESC LIMIT 1

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 'urgence environnementale' OR h.url='Notre savoir-faire/Exercice de simulation d'' at line 13