PHP mysqli: get_client_version() function
mysqli_get_client_version function / mysqli::$client_version
The mysqli_get_client_version function / mysqli::$client_version — returns the MySQL client version as an integer.
Syntax:
Object oriented style
int $mysqli->client_version;
Procedural style
int mysqli_get_client_version ( mysqli $link )
Usage: Procedural style
mysqli_get_client_version(connection);
Parameter:
Name | Description | Required/Optional |
---|---|---|
connection | Specifies the MySQL connection to use. | Optional |
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 exits.
Version: PHP 5, PHP 7
Example of procedural style:
<?php
/* We don't need a connection to determine
the version of mysql client library */
printf("Client library version: %d\n", mysqli_get_client_version());
?>
Output:
Client library version: 50005
Example:
<?php
echo mysqli_get_client_version();
?>
Output:
50005
See also
Previous: get_client_stats
Next: get_connection_stats
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/php/function-reference/mysqli_get_client_version.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics