mysql_get_host_info
(PHP 4 >= 4.0.5, PHP 5)
mysql_get_host_info — 取得 MySQL 主機資訊
說明
mysql_get_host_info(resource
$link_identifier
= ?): string
mysql_get_host_info() 返回一個字串說明了連線
link_identifier
所使用的連線方式,包括伺服器的主機名。如果省略
link_identifier
,則使用上一個打開的連線。
示例 #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()。