vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Would like help/advice on SQL query... (https://vborg.vbsupport.ru/showthread.php?t=47965)

LeeCHeSSS 01-21-2003 11:05 AM

Would like help/advice on SQL query...
 
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*


All times are GMT. The time now is 12:07 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00951 seconds
  • Memory Usage 1,713KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete