Jump to content

Archived

This topic is now archived and is closed to further replies.

Germaris

PHP-MySQL: Query for stats

Recommended Posts

Hi there!

I manage a directory of ancient students of about forty french military schools.
The website is made in Flash but it doesn't matter because I am quite good in Flash-MySQL communication via PHP Scripts.

I'm planning to build a page where users can get, in one click the full school list with, FOR EACH of them, the total of students listed in the directory.

I have no idea of the query I must write to obtain this...
Is there anyone who can help me ?
Many thanks in advance.

Regards

Share this post


Link to post
Share on other sites
Yes, I know that. But the problem is how to write ONE query for ALL the schools, i.e. how to get forty different numbers (one total for each school) with only one query ?

Will it be something like :

$query =mysql_query ("SELECT * FROM $table WHERE school1 = '$a' AND school2 = '$b' AND school3 = '$c' COUNT" ) or die ( "select error " .mysql_error () );

???

Thanks for your time !

Share this post


Link to post
Share on other sites
you need sum and count ok heres a link i use for any mysql problams keep it ok.

http://www.1keydata.com/sql/sqlcount.html

http://www.1keydata.com/sql/sqlfunctions.html

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.