CAn anyone point me in a direction for showing how many MySQL queries were run? Example: http://neowin.net/#aa064b58 look at the very bottom of the page it says "4 queries run"
"status" will show you queries example mysql> status -------------- Threads: 104 Questions: 2800453 Slow queries: 114 Opens: 1197 Flush tables: 1 Open tables: 1024 Queries per second avg: 70.062 -------------- mysql>
Several ways If its like me, I dont mean to leave them there, I add a one every time I create a query, so I can keep an eye, make sure I dont do too many. You could also have a var set up At the top $num_queries = 0; Each query just add $num_queries = $num_queries +1; This will make it dynamic Then echo $num_queries; The Dynamic Way
That's their CMS or custom script simply counting how many queries they needed to get the info for that page.
There's no way of telling this without counting it yourself. That's the basic answer. If you think about it, how would it work anyway? All the MySQL server knows is that it's being asked for information. It has no idea that a PHP script is requesting it, let alone which of maybe dozens of running scripts are making the request...
If you use something like $queryx for your queries, where X is a number Then count how many times $query is on the page
Btw, counting the queries is easy if you use a database abstraction layer. You can also count how long the queries take. In fact, it's required for any programmer to make sure you don't do something stooopid. I do it all the time.
if still some one is looking for an answer, here you go, stackoverflow.com/questions/830489/how-can-i-count-the-total-number-of-mysql-queries-used-per-page