PHP mysqli_get_connection_stats() Function

Definition

The mysqli_get_connection_stats() function returns statistics about the client connection.

Syntax

Object oriented style

bool mysqli::get_connection_stats ( void )

Procedural style

array mysqli_get_connection_stats ( mysqli $link )

Parameter

ParameterIs RequiredDescription
connectionRequired.MySQL connection

Return

Returns an array with connection stats if success, FALSE otherwise.

Example

The following code gets stats about the client connection.


<?php/*from  w w w  .j a va 2s .c  om*/
$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);

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


?>




















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions