You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'mayor.php')' or seo_url = 'javaScript:openWindow('mayor.php')' LIMIT 1' at line 1 SELECT * FROM visitor_info WHERE visitor_info_id = 'javaScript:openWindow('mayor.php')' or seo_url = 'javaScript:openWindow('mayor.php')' LIMIT 1