Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   PHP (https://www.askmehelpdesk.com/forumdisplay.php?f=454)
-   -   SQL count query in PHP (https://www.askmehelpdesk.com/showthread.php?t=762886)

  • Aug 16, 2013, 07:08 AM
    jmguevarra
    SQL count query in PHP
    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

  • All times are GMT -7. The time now is 02:41 AM.