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//from   ww  w  .  j  a  va  2  s  . co m
$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);
?>




















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions