Return statistics about client connections:
<?php$con=mysqli_connect("localhost","my_user","my_password","my_db");//Detect connection if (mysqli_connect_errno($con)) { echo "Database connection failed: " . mysqli_connect_error(); }print_r(mysqli_get_connection_stats($con));mysqli_close($con);?>The mysqli_get_connection_stats() function returns statistics about client connections.
mysqli_get_connection_stats( connection ) ;
parameter | describe |
---|---|
connection | Required. Specifies the MySQL connection to use. |
Return value: | Returns an array with connection statistics if successful, or FALSE if failed. |
---|---|
PHP version: | 5.3+ |