PHP mysqli: client_version() function

mysqli_get_client_version() function / mysqli::$client_version

The mysqli_get_client_version() function / mysqli::$client_version is used to get Client library version as an integer.


Object oriented style

int $mysqli->client_version;

Procedural style

int mysqli_get_client_version ( mysqli $link )

Usage: Procedural style


Return value:

A number that represents the MySQL client library version in format: main_version*10000 + minor_version *100 + sub_version. For example, 4.1.0 is returned as 40100.

This is useful to quickly determine the version of the client library to know if some capability exists.

Version: PHP 5, PHP 7


/* We don't need a connection to determine
   the version of mysql client library */

printf("Client library version: %d\n", mysqli_get_client_version());

Sample Output:

Client library version: 50005

See also

PHP Function Reference

Previous: client_info
Next: close

Follow us on Facebook and Twitter for latest update.