PDA

View Full Version : Would like help/advice on SQL query...


LeeCHeSSS
01-21-2003, 11:05 AM
I'm throwing together a little statistics page (www.online-roleplaying.com/forums/statistics.php) and asked a few of my members what sort of statistics they would like.

Surprisingly, the one with the most posts per day, suggested a list of people with the highest posts per day values.

It's a good idea, but after having taken a look through the vbulletin files (to figure out how Jelsoft calculated it), I got the impression it's pretty difficult to create a list of users sorted by this condition.

Anyone of you guys got ideas?

Xenon
01-21-2003, 12:18 PM
Hmm i've tried something like that:

SELECT username, (posts / (". time()."-signupdate)/3600*24) AS postsperday FROM user ORDER By postsperday

it has ordered in some way but i didn't found out how ^^

LeeCHeSSS
01-21-2003, 12:59 PM
*marvels at Xenon's intellect*

Replace signupdate with joindate and it DOES sort them properly. Now somehow using $user[postsperday] is set to 0.0000

I bet I'm overlooking something, so feel free to point it out to me :)

Xenon
01-21-2003, 01:20 PM
yeah, meant joindate, but there i also have had some problems ;)

LeeCHeSSS
01-21-2003, 04:26 PM
What a big difference 1 pair of ()'s makes... *blushes*