Current Location: Home> Function Categories> get_proto_info

get_proto_info

Returns the MySQL protocol version.
Name:get_proto_info
Category:Uncategorized
Programming Language:php
One-line Description:Returns the MySQL protocol version.

Definition and usage

mysqli_get_proto_info() function returns the MySQL protocol version.

Example

Example 1 - Object-Oriented Style

Return to the MySQL protocol version:

 <?php
$mysqli = new mysqli ( "localhost" , "my_user" , "my_password" , "my_db" ) ;

if ( $mysqli -> connect_errno ) {
  echo "Failed to connect to MySQL: " . $mysqli -> connect_error ;
  exit ( ) ;
}

echo $mysqli -> protocol_version ;

$mysqli -> close ( ) ;
?>

Example 2 - Procedural Style

Return to the MySQL protocol version:

 <?php
$con = mysqli_connect ( "localhost" , "my_user" , "my_password" , "my_db" ) ;

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

echo mysqli_get_proto_info ( $con ) ;

mysqli_close ( $con ) ;
?>

grammar

Object-oriented style:

 $mysqli -> protocol_version

Procedural Style:

 mysqli_get_proto_info ( connection )
parameter describe
connection Required. Specifies the MySQL connection to use.
Similar Functions
Popular Articles