Here is my code

$query= mysql_query("SELECT course_code,COUNT(*) FROM tally GROUP BY course_code;");

I have tested this line first on my XAMPP SQL
SELECT course_code,COUNT(*) FROM tally GROUP...