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 is_deleted!='1' AND is_shown_in_site='1' GROUP BY course_id ORDER BY d...' at line 1