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

Syntax: mysql_stat(connection)
Description:

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.

Example:
Code:

$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();

Output:

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