PDA

View Full Version : SQL count query in PHP


jmguevarra
Aug 16, 2013, 07:08 AM
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 BY course_code

and it ouputs the data I want but when it comes to PHP query
I have no idea how to fetch the query and display it

the aim was to display all the course name and its count