PDF(美国高级主任)- 2.4 mb
PDF (A4)- 2.4 mb
HTML下载(TGZ)- 251.4 kb
HTML下载(Zip)- 258.9 kb
mysqli: server_info美元
mysqli: get_server_info
mysqli_get_server_info
返回MySQL服务器的版本
描述
面向对象的风格
字符串mysqli - > server_info;
公共字符串mysqli: get_server_info();
程序上的风格
字符串mysqli_get_server_info(mysqlimysql);
返回一个字符串,表示MySQLi扩展连接到的MySQL服务器的版本。
参数
-
链接
-
仅限过程式样式:返回的链接标识符
mysqli_connect
或mysqli_init
返回值
表示服务器版本的字符串。
例子
例3.50mysqli - > server_info
例子
面向对象的风格
< ?PHP $mysqli = new mysqli("localhost", "my_user", "my_password");/*检查连接*/ if (mysqli_connect_errno()) {printf("Connect failed: %s\n", mysqli_connect_error());退出();} /*打印服务器版本*/ printf("服务器版本:%s\n", $mysqli->server_info);/*关闭连接*/ $mysqli->close();? >
程序上的风格
< ?PHP $link = mysqli_connect("localhost", "my_user", "my_password");/*检查连接*/ if (mysqli_connect_errno()) {printf("Connect failed: %s\n", mysqli_connect_error());退出();} /*打印服务器版本*/ printf("服务器版本:%s\n", mysqli_get_server_info($link));/ / mysqli_close($link);? >
上面的例子将输出:
服务器版本:4.1.2-alpha-debug
另请参阅
mysqli_get_client_info |
mysqli_get_client_version |
mysqli_get_server_version |