定义和用法
mysql_stat() 函数返回 MySQL 服务器的当前系统状态。
如果成功,则该函数返回状态。如果失败,则返回 false。
语法mysql_stat(connection)
提示和注释
注释:mysql_stat() 目前只返回 uptime、threads、queries、open tables、flush tables 和 queries per second。要得到其它状态变量的完整列表,只能使用 SQL 命令 SHOW STATUS。
例子<?php $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();?>
输出类似:Uptime: 99410 Threads: 1 Questions: 162Slow queries: 0 Opens: 0 Flush tables: 1Open tables: 0 Queries per second avg: 0.002
本文出自:琅枫个人博客。如需转载请注明出处!
本文出处:"https://www.phpfeng.cn/function/440.html"