I use mybb, how can I find the 5 best topics with the most readers?

I use MyBB , I want to show topics on the home page of the site in which the most readers are currently .

I assume I need to query the session table, but I'm not sure how to do this.

The mysql result I need should look something like this:

------------------------- |title | count | ------------------------- |thread a title | 1234 | |thread b title | 913 | |thread c title | 678 | |another title | 593 | |different title| 550 | ------------------------- 

Thanks:)

+4
source share
1 answer

I just checked this on my board, I think this is what you need:

 SELECT COUNT(*) as count, subject as title FROM `mybb_sessions`,`mybb_threads` WHERE location1 = tid GROUP BY `location1` ORDER BY COUNT(*) DESC LIMIT 10 
+4
source

All Articles