(PHP 5, PHP 7)
mysqli::$server_info -- mysqli_get_server_info — 锟斤拷锟斤拷MySQL锟斤拷锟斤拷锟斤拷锟侥版本锟斤拷
锟斤拷锟斤拷锟斤拷锟斤拷锟�
锟斤拷锟教伙拷锟斤拷锟�
锟斤拷锟斤拷一锟斤拷锟街凤拷锟斤拷锟斤拷锟斤拷锟斤拷MySQLi锟斤拷展锟斤拷锟接碉拷MySQL锟斤拷锟斤拷锟斤拷锟侥版本锟斤拷.
一锟斤拷锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟侥版本.
Example #1 $mysqli->server_info 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: %s\n", $mysqli->server_info);
/* 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: %s\n", mysqli_get_server_info($link));
/* close connection */
mysqli_close($link);
?>
锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�
Server version: 4.1.2-alpha-debug