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 'LIMIT 1' at line 14 SQL: SELECT zooshop.*, goroda.url as gorod_url, goroda.gorod as gorod_name FROM zooshop LEFT JOIN goroda ON goroda.id=zooshop.gorod WHERE zooshop.id= LIMIT 1