Quote:
05-17-03 at 06:08 AM Xenon said this in Post #9
@squawell: yes right, every variabole appearing in the template has to be before that eval!
@boofo:
it would slow down the query but i think this should do the trick:
PHP Code:
$post7day = $DB_site->query_first("
SELECT DISTINCT(post.userid), COUNT(postid) AS posts, user.username
FROM post
LEFT JOIN user USING(userid)
LEFT JOIN thread USING(threadid)
WHERE post.userid > 0 AND post.dateline>=$d AND thread.forumid=xx
GROUP BY post.userid
ORDER BY posts DESC
LIMIT 1
");
|
I tried this code and this is the error I got.
Database error in vBulletin 2.2.9:
Invalid SQL: SELECT DISTINCT(post.userid), COUNT(postid) AS posts, user.username
FROM post
LEFT JOIN user USING(userid)
LEFT JOIN thread USING(threadid)
WHERE post.userid > 0 AND post.dateline>=1052895600 AND thread.forumid=34
GROUP BY post.userid
ORDER BY posts DESC
LIMIT 1
mysql error: Unknown column 'user.threadid' in 'on clause'
mysql error number: 1054
Date: Wednesday 21st of May 2003 06:31:41 AM
Script:
http://www.bearfacts2.com/forum/foru...php?forumid=34
Referer:
http://www.bearfacts2.com/forum/
Repair Report: This type of error cannot be automatically repaired.