Current Location: Home> Function Categories> get_server_info

get_server_info

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

Definition and usage

server_info / mysqli_get_server_info() function returns the MySQL server 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 -> server_info ;

$mysqli -> close ( ) ;
?>

Example 2 - Procedural Style

Return to the MySQL server 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_server_info ( $con ) ;

mysqli_close ( $con ) ;
?>
Similar Functions
Popular Articles