Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

18.2. Functions > mysql_get_host_info

Name

mysql_get_host_info

Synopsis

string mysql_get_host_info([cresource connection])

Returns a string that describes a MySQL server connection. The string contains the type of connection (TCP or Unix socket) and the hostname. An optional connection resource handle may be provided as the parameter; otherwise, the most recently opened connection that is still open is assumed. This function is available only in PHP 4.0.5 or later versions.

Example

<?php
  mysql_connect("localhost", "root", "drum");
  
  // Prints: This is a Localhost via UNIX socket connection to MySQL.   
  echo "This is a " . mysql_get_host_info(  ) . " connection to MySQL.";
?>

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint