1064 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 ') or p.master_categories_id in (select categories_id from categories where paren' at line 1
in:
[select count(*) as total FROM products p LEFT JOIN manufacturers m on (p.manufacturers_id = m.manufacturers_id), products_description pd WHERE p.products_status = 1 AND (p.master_categories_id in () or p.master_categories_id in (select categories_id from categories where parent_id in ()) or p.master_categories_id in (select categories_id from categories where parent_id in (select categories_id from categories where parent_id in ()))) AND p.products_id = pd.products_id and pd.language_id = 3 ]