The mysqli_get_client_version() function returns the MySQL client library version as an integer.
Object oriented style
int $mysqli->client_version;
Procedural style
int mysqli_get_client_version ( mysqli $link )
Parameter | Is Required | Description |
---|---|---|
connection | Optional. | MySQL connection |
The mysqli_get_client_version() function returns the MySQL client library version as an integer.
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);
?>