| PHP4 | PHP5 | PHP7 |
|---|---|---|
| 不支持 | 支持 | 支持 |
mysqli_get_host_info ( mysqli $link )
返回一个字符串,描述被link 参数所表述的连接 (包括服务器主机名).
| 参数 | 必需的 | 描述 |
|---|---|---|
| link | 是 | 由 mysqli_connect() 或 mysqli_init() 返回的链接标识。 |
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
/* print host information */
printf("Host info: %s\n", mysqli_get_host_info($link));
/* close connection */
mysqli_close($link);
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69942367/viewspace-2663828/ ,如需转载,请注明出处,否则将追究法律责任。