PHP mysql_get_host_info() Function Example

PHP mysql_get_host_info() Function Example


Posted in : PHP Posted on : February 21, 2011 at 6:34 PM Comments : [ 0 ]

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

Download Example Code

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics