MYSQL QUERY: SELECT, o.sort_id, o.item_id,, o.pic_name, o.html_name, o.car_begin, o.car_end, od.oil_short_description AS short_descr, od.oil_description AS description, od2.oil_description AS description_default, o.keyword, o.status, o.changed_at, o.published, osl1.subcategory_name AS 'category_name', AS 'cetegory_id', s1.category_alias AS 'category_alias', osl2.subcategory_name AS 'group_name', AS group_id, ( CASE WHEN cpa.page_alias !='' THEN cpa.page_alias ELSE cpa2.page_alias END ) AS 'group_alias', ossorl.oil_sort_name AS sort_name, o.shop_link, oil_shop_links.shop_link AS 'lang_shop_link' FROM oil o LEFT JOIN oil_subcategory_assoc_oil sao ON = sao.oil_id LEFT JOIN oil_subcategory s ON sao.subcategory_id = LEFT JOIN oil_subcategory_lang osl ON osl.oil_subcategory_id = AND osl.id_lang LIKE 'ru' LEFT JOIN oil_subcategory s1 ON = s.parent_id LEFT JOIN oil_subcategory_lang osl1 ON osl1.oil_subcategory_id = AND osl1.id_lang LIKE 'ru' LEFT JOIN oil_subcategory s2 ON = s1.parent_id LEFT JOIN oil_subcategory_lang osl2 ON osl2.oil_subcategory_id = AND osl2.id_lang LIKE 'ru' LEFT JOIN oil_shop_links ON oil_shop_links.oil_id = AND oil_shop_links.id_lang LIKE 'ru' LEFT JOIN cms_page_alias cpa ON cpa.get_param = AND cpa.id_lang LIKE 'ru' LEFT JOIN cms_page_alias cpa2 ON cpa2.get_param = AND cpa2.id_lang LIKE 'en' LEFT JOIN oil_description od ON = od.oil_id AND od.language_id LIKE 'ru' LEFT JOIN oil_description od2 ON = od2.oil_id AND od2.language_id LIKE 'en' LEFT JOIN oil_sort so ON o.sort_id = LEFT JOIN oil_sort_lang ossorl ON ossorl.oil_sort_id = AND ossorl.id_lang LIKE 'ru' WHERE =

MYSQL ERROR: 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 '' at line 42