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
Parameter | Is Required | Description |
---|---|---|
connection | Optional. | 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);
?>