PHP mysqli_get_connection_stats() Function

PHP mysqli_get_connection_stats() function returns client connection statistics.

Syntax

array mysqli_get_connection_stats(connection);

mysqli_get_connection_stats() Function Parameter

ParameterDescription
Connection :Required parameter. The MySQL connection to be used.

mysqli_get_connection_stats() Function Return Value

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

mysqli_get_connection_stats() Function Example

<?php
$con = mysqli_get_charset("localhost","user","password","db");

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

// Get MySQL client connection statistics
echo mysqli_get_connection_stats($con);

?>