PHP mysqli_get_proto_info() function returns the version of the MySQL protocol used.
Syntax
int mysqli_get_proto_info(connection);
Parameter | Description |
---|---|
Connection : | Required parameter. The MySQL connection to be used. |
Return Values : | Returns an integer representing the protocol version. |
<?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); ?>