select count(t1.ctproduct_id) as totalctproducts from trdmg_ctproducts as t1 where t1.ctcat_id in(81,82,87,88,98) and site_lang="ru" and t1.ctproduct_locked=0 and t1.ctbrand_id in()
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 1