Ask Experts Questions for FREE Help !
Ask
    jmguevarra's Avatar
    jmguevarra Posts: 1, Reputation: 1
    New Member
     
    #1

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

Check out some similar questions!

I received a final judgment by defaul on count 1 on a 2 count lawsuit [ 0 Answers ]

1st count has been set by default On the second count my attorney told me that we have a trail date on Friday (nov 4th which I understood it was in front of a jury) somehow today he tells me we do not have the right to a jury trial What is the reason for this?

Writing SQL query output into text files of configsize (shell script & MySQL code at) [ 0 Answers ]

In the application requirement, the current and required funcationality are as follows:- Current scenario:- (I)A MySQL stored proc is called from the shell script as given in below code. (ii)The procedure generates the transaction dump file by querying the relevant table And using the syntax...

Writing SQL query output into text files of fixed size [ 0 Answers ]

I have a stored procedure in MySQL that writes the output of a query to a textfile Using SELECT * FROM tbl INTO OUTFILE <file_name_datetime>. I call this procedure from a Linux shell script for automated file generation. I want to configure this process, by defining the maximum filesize during...

How to reference multiple tables in a SQL Server Query/select Statement [ 1 Answers ]

When running a select statement select field1, field2, field3, field4 from table1 The values for field2 and field3 are a "code"... The value of the code in field2 is in table2, and the value for the code in field3 is in table3 Example: Field2=16 , In the employee table, There is a column...


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.