The function returns the current system status of the MySQL server.

Syntax: mysql_stat(connection)

The argument “connection” is Optional. It specifies the MySQL connection. If not specified, the last connection opened by mysql_connect() or mysql_pconnect() is used.

This function returns status on success, or NULL on failure.


$connection = mysql_connect("localhost", "mysql_user", "mysql_password");
if (!$connection)
  die('Could not connect: ' . mysql_error());

$db_selected = mysql_select_db("company", $connection);

echo mysql_stat();


Uptime: 18463 Threads: 1 Questions: 10 Slow queries: 0 Opens: 12
Flush tables: 1 Open tables: 0 Queries per second avg: 0.001

eXTReMe Tracker