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)
Parameter Description
connection Optional. Specifies the MySQL connection. If not specified, the previous connection is used.

Description

mysql_get_host_info() returns a string that describes the connection connection The connection method used, including the server hostname. If omitted connectionIf not, use the previous 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