Definition and usage
mysqli_get_server_version () function returns the MySQL server version as an integer. Linear Motor
MySQL server version will return the following format: major version 10000 + minor version 100 + subversion. For example: 5.1.0 will return 50100.
grammar
mysqli_get_server_version(connection);
Examples of
the MySQL server version as an integer Returns:
<?php
$con=mysqli_connect("localhost","my_user","my_password","my_db");
// 检测连接
if (mysqli_connect_errno($con))
{
echo "数据库连接失败: " . mysqli_connect_error();
}
echo mysqli_get_server_version($con);
mysqli_close($con);
?>