mysql_get_host_info() function in PHP

What is mysql_get_host_info() function in PHP?
How does mysql_get_host_info() works?

Explanation

This mysql_get_host_info() function gets information about the MySQL host.
Syntax
string mysql_get_host_info ( [resource link_identifier])

Returns a string describing the type of connection in use, including the server host name or FALSE on failure.
mysql_get_host_info() returns a string describing the type of connection in use for the connection link_identifier, including the server host name. If link_identifier is omitted, the last opened connection will be used.
Example

<?php
//print server host information
printf("MySQL host info: %sn", mysql_get_host_info());
?>

RESULT:
MySQL host info: Localhost via UNIX socket
See also:
mysql_get_client_info(), mysql_get_proto_info() and mysql_get_server_info().

PHP Topics


Ask Questions

Ask Question