The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
What is the query to run for counting thread views?
I have: $countviews=$DB_site->query_first('SELECT COUNT(*) AS views FROM thread'); $totalviews=number_format($countviews['views']); Which of course doesn't work. What do I need to change to get this work right? Thanks, Parker |
#2
|
||||
|
||||
i don't test this code so i don't know can work or not
PHP Code:
|
#3
|
||||
|
||||
You need to use SUM
(http://www.mysql.com/doc/G/r/Group_by_functions.html), like this: Code:
$countviews=$DB_site->query_first('SELECT SUM(views) AS totalviews FROM thread'); $totalviews=number_format($countviews[totalviews]); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|