Function: mysql_get_host_info()
Applicable version: PHP 4, PHP 5, PHP 7
Usage: The mysql_get_host_info() function is used to obtain the MySQL host information of the currently connected.
Syntax: string mysql_get_host_info ([ resource $link_identifier = NULL ] )
parameter:
Return value: Returns a string representing the current connection MySQL host information.
Example: <?php // Create a MySQL connection $link = mysql_connect('localhost', 'user', 'password'); if (!$link) { die('Could not connect: ' . mysql_error()); }
// Get the MySQL host information of the currently connected $host_info = mysql_get_host_info($link); echo "MySQL host info: " . $host_info;
// Close the connection mysql_close($link); ?> Output: MySQL host info: localhost via TCP/IP
Notes: