MyBB Community Forums

Full Version: Number of Queries
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I found at the bottom of the admin cp, the number of queries per second. How can view in index or every page ???
Open the Admin CP and go to Configuration -> Server and Optimization Options -> Advanced Stats / Debug information -> set it to Yes. For administrators, it should then appear on every page at the bottom right. (Albeit in a more detailed form.)

That's the default setting, by the way. There's a good chance it's already visible. It looks something like this:

Quote:Generated in 0.0200181 seconds (89.89% PHP / 10.11% MySQL)
SQL Queries: 9 / Global Parsing Time: 0.0111880 / Memory Usage: 4.25 MB
PHP version: X.X.X / Server Load: Unknown / GZip Compression: Disabled
How can I show only the number of queries everybody? (Visitors, members and bots)
You could add {$db->query_count} to a template of your choice, for example the footer.

However this will show the number of queries at the time the template was evaluated. MyBB may evaluate the footer template and then make some additional queries afterwards, so in the footer template it may show 6 queries when the debug info tells you that it really were 9 or 17 queries.

For a more accurate number you'd have to modify code / write a plugin, I guess.

It seems the full html template of a page (index, forumdisplay, showthread), always gets evaluated last, so you could put {$db->query_count} there, before the </body> tag. It'd probably not go too well with your theme though.