Mysql Tutorial: mysql_stat () query the current system status of the MySQL server
Definition and usage
The mysql_stat () function returns the current system status of the MySQL server.
If yes, the function returns the status. If it fails, false is returned.
Syntax
Description of the mysql_stat (connection) parameter
Connection is optional. MySQL connection is required. If not specified, the previous connection is used.
Tips and comments
Note: currently, mysql_stat () Only returns uptime, threads, queries, open tables, flush tables, and queries per second. To obtain a complete list of other state variables, you can only use the SQL command SHOW STATUS.
Example
$ Con= mysql_connect ("localhost", "hello", "321 ");
If (! $ Con)
{
Die ('could not connect: '. mysql_error ());
}
$ Db_selected = mysql_select_db ("test_db", $ con );
Echo mysql_stat ();
?>
The output is similar:
Uptime: 99410 Threads: 1 Questions: 162
Slow queries: 0 Opens: 0 Flush tables: 1
Open tables: 0 Queries per second avg: 0.002
Note: For more exciting articles, please follow the help houseProgramming TutorialTopic.