![]() |
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 |
i don't test this code so i don't know can work or not
PHP Code:
|
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 |
All times are GMT. The time now is 07:01 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|