定义

mysqli_get_connection_stats()函数返回有关客户端连接的统计信息。

 

语法

面向对象的风格:

bool mysqli::get_connection_stats ( void )

程序风格:

array mysqli_get_connection_stats ( mysqli $  )

 

参数

参数 是否必须 描述
需要。 MySQL连接

 

返回值

如果成功,返回具有连接统计信息的数组,否则返回FALSE。

 

实例

以下代码获取有关客户端连接的统计信息。

<?php
//  http://www.manongjc.com/article/1673.html
//  作者:码农教程
$con=mysqli_connect(\"localhost\",\"my_user\",\"my_password\",\"my_db\");

if (mysqli_connect_errno($con)){
  echo \"Failed to connect to MySQL: \" . mysqli_connect_error();
}

print_r(mysqli_get_connection_stats($con));

mysqli_close($con);

$  = mysqli_connect();
print_r(mysqli_get_connection_stats($ ));


?>
收藏 打印