PHP Tutorial - PHP mysqli_get_client_version() Function






Definition

The mysqli_get_client_version() function returns the MySQL client library version as an integer.

Syntax

Object oriented style

int $mysqli->client_version;

Procedural style

int mysqli_get_client_version ( mysqli $link )

Parameter

ParameterIs RequiredDescription
connectionOptional.MySQL connection

Return

The mysqli_get_client_version() function returns the MySQL client library version as an integer.

Example

For example, 5.1.0 is returned as 50100.

The following gets the MySQL client library version as an integer.


<?php/*w w  w  . j  a va2s .c  om*/
$con=mysqli_connect("localhost","my_user","my_password","my_db");

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

print_r(mysqli_get_client_version($con));

mysqli_close($con);
?>