Jump to content

Averages based on information from a database


-Karl-

Recommended Posts

I have a table called members, in it I have

 

usernameurlattack

 

An example would be

myusernamewww.google.com99

anotherusernamewww.phpfreaks.com95

 

What I want to do is calculate averages. So select all the information from the members table.

 

Then group the result by their url, and carry out a calculation. The calculation would be easy. Add up all the levels (attack), divided by the amount of users with that url.

 

I'm not sure how to go about getting the data and splitting it however, then I'd carry out the calculation and echo the highest number, followed by the clanurl.

 

Any ideas?

Archived

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

×
×
  • Create New...

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.