Germaris Posted October 18, 2006 Share Posted October 18, 2006 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 Link to comment https://forums.phpfreaks.com/topic/24384-php-mysql-query-for-stats/ Share on other sites More sharing options...
redarrow Posted October 18, 2006 Share Posted October 18, 2006 count($what_ever) Link to comment https://forums.phpfreaks.com/topic/24384-php-mysql-query-for-stats/#findComment-110922 Share on other sites More sharing options...
Germaris Posted October 18, 2006 Author Share Posted October 18, 2006 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 ! Link to comment https://forums.phpfreaks.com/topic/24384-php-mysql-query-for-stats/#findComment-110940 Share on other sites More sharing options...
redarrow Posted October 18, 2006 Share Posted October 18, 2006 you need sum and count ok heres a link i use for any mysql problams keep it ok.http://www.1keydata.com/sql/sqlcount.htmlhttp://www.1keydata.com/sql/sqlfunctions.html Link to comment https://forums.phpfreaks.com/topic/24384-php-mysql-query-for-stats/#findComment-110943 Share on other sites More sharing options...
Germaris Posted October 19, 2006 Author Share Posted October 19, 2006 OK. I'll give it a try... Thanks! Link to comment https://forums.phpfreaks.com/topic/24384-php-mysql-query-for-stats/#findComment-110951 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.