The mysql_stat() function is used to get current system status.
(PHP 4 and above)
|connection||The MySQL connection. Before performing any operation on a MySQL database, it is required to set a connection to the mysql database you want to work with. And this is done by mysql_connect() function. This function takes three parameters, name of the host, username with which you want to perform tasks with the mysql database in question, and password of that user. As soon as a successful connection is established, you can perform the operations on that mysql database. In case, no such connection is found, it will try to create one without any arguments, i.e. mysql_connect() without any parameters. If it fails to connect to a mysql database, it will generate a warning (E_WARNING) but not an error.||Optional||Resource|
A string with the status for uptime, threads, queries, open tables, flush tables and queries per second.
Value Type : String
<?php $con = mysql_connect('localhost', 'root', 'mypass'); $db_status = explode(' ', mysql_stat($con)); print_r($db_status); ?>
Array (  => Uptime: 965  => Threads: 1  => Questions: 11  => Slow queries: 0  => Opens: 13  => Flush tables: 1  => Open tables: 7  => Queries per second avg: 0.011 )
Your output may vary.