mysql_get_host_info()
(PHP 4 >= 4.0.5, PHP 5)
取得 MySQL 主机信息
说明
mysql_get_host_info([resource $link_identifier]): string
mysql_get_host_info()返回一个字符串说明了连接$link_identifier所使用的连接方式,包括服务器的主机名。如果省略$link_identifier,则使用上一个打开的连接。
Example #1 mysql_get_host_info()例子
<?php mysql_connect("localhost", "mysql_user", "mysql_password") or die("Could not connect: " . mysql_error()); printf ("MySQL host info: %s\n", mysql_get_host_info()); ?>
以上例子将产生如下输出:
MySQL host info: Localhost via UNIX socket
参见mysql_get_client_info(),mysql_get_proto_info()和mysql_get_server_info()。