PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<mysql_get_client_infomysql_get_proto_info>
Last updated: Mon, 16 Jul 2012

mysql_get_host_info

(PHP 4 >= 4.0.5, PHP 5)

mysql_get_host_info -- 取得 MySQL 主机信息

说明

string mysql_get_host_info ( [resource link_identifier] )

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()




<mysql_get_client_infomysql_get_proto_info>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST