PHP mysql_get_host_info() Function
Definition and Usage
The mysql_get_host_info() function returns the information about the MySQL host.
If successful, it returns the type of the current MySQL connection being used, if failed, it returns false.
Syntax
mysql_get_host_info(connection)
Parameter | Description |
---|---|
connection | Optional. Specifies the MySQL connection. If not specified, the last connection is used. |
Description
mysql_get_host_info() returns a string that explains the connection connection The connection method used, including the server hostname. If omitted connectionIf not, use the last opened connection.
Example
<?php $con = mysql_connect("localhost", "hello", "321"); echo "MySQL host info: " . mysql_get_host_info($con); ?>
Output:
MySQL host info: localhost via TCP/IP