PHP mysqli_get_proto_info() Function

PHP mysqli_get_proto_info() function returns the version of the MySQL protocol used.

Syntax

int mysqli_get_proto_info(connection);

mysqli_get_proto_info() Function Parameter

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

mysqli_get_proto_info() Function Return Value

Return Values :Returns an integer representing the protocol version.

mysqli_get_proto_info() 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 protocol version
echo mysqli_get_proto_info($con);

mysqli_close($con);
?>