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 'AND activated > 0 AND cat_id = "") AND activated > 0 AND deleted = 0 AND cat_...' at line 1