PHP mysql_get_host_info() Function
Definition and Usage
The mysql_get_host_info() function returns information about the MySQL host.
If successful, returns the type of the current MySQL connection being used, if failed, returns false.
Syntax
mysql_get_host_info(connection)
Parameters | 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's hostname. If omitted connectionIf not specified, 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