Jump to content


Photo

PHP-MySQL: Query for stats


  • Please log in to reply
4 replies to this topic

#1 Germaris

Germaris
  • Members
  • PipPipPip
  • Advanced Member
  • 97 posts
  • LocationCanada

Posted 18 October 2006 - 11:10 PM

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


#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 18 October 2006 - 11:15 PM

count($what_ever)



Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 Germaris

Germaris
  • Members
  • PipPipPip
  • Advanced Member
  • 97 posts
  • LocationCanada

Posted 18 October 2006 - 11:48 PM

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 !


#4 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 18 October 2006 - 11:52 PM

you need sum and count ok heres a link i use for any mysql problams keep it ok.

http://www.1keydata....l/sqlcount.html

http://www.1keydata....lfunctions.html
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#5 Germaris

Germaris
  • Members
  • PipPipPip
  • Advanced Member
  • 97 posts
  • LocationCanada

Posted 19 October 2006 - 12:05 AM

OK. I'll give it a try... Thanks!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users