(PHP 5, PHP 7)
mysqli::$server_version -- mysqli_get_server_version — ��Ϊһ����������MySQL�������İ汾
���������
���̻����
mysqli_get_server_version()��������������ʽ���ر����ӵ�link
�����������ķ������İ汾.
һ�����������ķ������汾.
�汾�ŵĸ�ʽ�� main_version * 10000 + minor_version * 100 + sub_version (���磺 �汾 4.1.0 �� 40100).
Example #1 $mysqli->server_version example
���������
<?php
$mysqli = new mysqli("localhost", "my_user", "my_password");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
/* print server version */
printf("Server version: %d\n", $mysqli->server_version);
/* close connection */
$mysqli->close();
?>
���̻����
<?php
$link = mysqli_connect("localhost", "my_user", "my_password");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
/* print server version */
printf("Server version: %d\n", mysqli_get_server_version($link));
/* close connection */
mysqli_close($link);
?>
�������̻������
Server version: 40102