Get MySQL protocol version in PHP

Description

The following code shows how to get MySQL protocol version.

Example


  // w  ww .ja  v a2  s. c om
<?php
     $con=mysqli_connect("localhost","root","","test");
     // Check connection
     if (mysqli_connect_errno()){
        echo "Failed to connect to MySQL: " . mysqli_connect_error();
     }
   
     echo mysqli_get_proto_info($con);
    
     mysqli_close($con);
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    MySQL »




MySQLi
MySQLi Object Oriented