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 '%D1%85%D0%BE%D0%B4%D1%83%D0%BD%D0%BA%D0%B8%20%D0%B4%D0%BB%D1%8F%20%D0%B4%D0%B5%D' at line 1
SELECT id FROM shop_categories WHERE parentid=%D1%85%D0%BE%D0%B4%D1%83%D0%BD%D0%BA%D0%B8%20%D0%B4%D0%BB%D1%8F%20%D0%B4%D0%B5%D1%82%D0%B5%D0%B9 LIMIT 1