SQL: select t1.*, t1.ct_id as id, t1.`ct_name` as ct_name_ru from `categories_type` as t1 left join categories_type_urls_seo as t2 on t2.ct_id=t1.ct_id and t2.iso='de' where t1.`ct_deleted` = 0 and t1.br_id = 4 and t1.pc_id = 16?iso=en group by t1.ct_name order by t1.`ct_name_de` asc 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 '?iso=en group by t1.ct_name order by t1.`ct_name_de` asc' at line 1