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 's-best-inn-&-suites' or seo_url = 'america's-best-inn-&-suites' LIMIT 1' at line 1 SELECT * FROM visitor_info WHERE visitor_info_id = 'america's-best-inn-&-suites' or seo_url = 'america's-best-inn-&-suites' LIMIT 1