The mysql_get_host_info() function returns information of mysql host.
PHP mysql_get_host_info() Function Example:
The mysql_get_host_info() function returns information of mysql host. This function returns type of mysql connection currently in use on success, or false for failure.
Syntax:
mysql_get_host_info(connection)
Where connection is optional. The connection specifies the mysql connection.
Example:
<?php $connection = mysql_connect("localhost", "root", "root"); if (!$connection) { die('PHP Mysql database connection could not connect : ' . mysql_error()); } echo "MySQL host info: " . mysql_get_host_info($connection); mysql_close($connection); ?>
After running this example you can see the output like:
Output:
MySQL host info: 192.168.10.13 via TCP/IP
[ 0 ] Comments