(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