Query failed : 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 'ezda-odintsova.html' LIMIT 4' at line 5 sql = SELECT l.anchor, l.url, l.id FROM linking_pages_links pl LEFT JOIN linking_pages p ON p.id = pl.page_id LEFT JOIN linking_links l ON l.id = pl.link_id WHERE p.url = 'http://www.kybinka.info/news/avto/item/1748-segodnya-proshlo-osveschenie-severnogo-ob'ezda-odintsova.html' LIMIT 4