PHP mysql_get_server_info() Function Example

PHP mysql_get_server_info() Function Example


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

The mysql_get_server_info() function returns information of mysql server.

PHP mysql_get_server_info() Function Example:

The mysql_get_server_info() function returns information of mysql server. This function returns version of the mysql server on success, or false for failure.

Syntax:

mysql_get_server_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 server info: " . mysql_get_server_info($connection);
mysql_close($connection);
?>

After running this example the browser output is:

Output:

MySQL server info: 5.0.19-nt

Download Example Code

Go to Topic «PreviousHomeNext»

Your Comment:


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

 
Tutorial Topics