mysqli_get_connection_stats()

本页内容

PHP mysqli_get_connection_stats() 函数

Category:PHP MySQLi 函数参考手册

返回有关客户端连接的统计:


示例

<?php

$con=mysqli_connect("localhost","my_user","my_password","my_db");

    // 检测连接

    if (mysqli_connect_errno($con))

  {

    echo "数据库连接失败: " . mysqli_connect_error();

  }

print_r(mysqli_get_connection_stats($con));

mysqli_close($con);

    ?>

定义和用法

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

语法

mysqli_get_connection_stats(connection);
参数 描述
connection 必需。规定要使用的 MySQL 连接。

技术细节

返回值: 如果成功则返回一个带有连接统计的数组,如果失败则返回 FALSE。
PHP 版本: 5.3+

Category:PHP MySQLi 函数参考手册

此页面最后编辑于2022年8月17日 (星期三) 22:27。