PHP Function Reference

PHP mysqli $client_version Property



The PHP mysqli::$client_version / mysqli_get_client_version() function returns the MySQL client version as an integer.

Syntax

//Object-oriented style
$mysqli->client_version;

//Procedural style
mysqli_get_client_version()

Parameters

No parameter is required.

Return Value

Returns an integer representing the MySQL client library version. The form of this version number is main_version * 10000 + minor_version * 100 + sub_version (i.e. version 4.1.0 is 40100). This is useful to quickly determine the version of the client library to know if some capability exists.

Example: mysqli_get_client_version() example

The example below shows the usage of mysqli_get_client_version() function.

<?php
//there is no need of a connection to determine 
//the version of mysql client library
printf("Client library version: %s\n", mysqli_get_client_version());
?>

The output of the above code will be similar to:

Client library version: 40102

❮ PHP MySQLi Reference