The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
SQL Query request...
Could somebody write me the syntax for an SQL query that would basically return the top ten posters of the day? Resultset should include userid, username and postcount for the day. I have a similar query that does overall top ten, but I want a second one that will show the same thing, only for today (since midnight OR over the last twenty four hours). I will mention the name and website of the person who writes this query for me on my website. Thanks in advance.
|
#2
|
|||
|
|||
do you already have a field (or is there? not sure) for how many posts are made in that day?
|
#3
|
||||
|
||||
It'll be a little more complicated than showing the overall top ten.
Firs you need the time interval... $searchdate = time() - 24 * 60 * 60; then the query: SELECT post.*, COUNT(userid) AS count FROM post WHERE dateline>$searchdate GROUP BY userid ORDER BY count DESC LIMIT 10 You'll get userame, id, and count will be the number of posts made in the last 24 hours. |
#4
|
|||
|
|||
Quote:
|
#5
|
||||
|
||||
modify searchdate in my post above so that instead of 24*60*60 (24 hours) it's the time that has passed from midnight till now.
|
#6
|
|||
|
|||
Quote:
...it works now and can be seen at: http://www.wizardingrealm.com/index.php?styleid=8 |
#7
|
|||
|
|||
Quote:
|
#8
|
||||
|
||||
Aww, thanks.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|