PHP MYSQL mysql_close – Close a connection to a MySQL server

The mysql_close function is used to disconnect from a MySQL Server.

Syntax:

boolean mysql_close (resource $DBHandle);

Arguments:
$DBHandle
A handle to an open MySQL server connection.

Return value:
If the disconnection is successful, the return value will be a boolean true.
If the disconnection fails, the return value will be a boolean false.

Example code:

<?php
 
$UserName = 'abc';
$Password = '8sj27s';
$DbHandle = mysql_connect ('localhost', $UserName, $Password);
if (!$DbHandle) {
  die 'No database connection could be established.';
}
 
mysql_close ($DbHandle);
?>
Share Article/Example:
  • DotNetKicks
  • DZone
  • StumbleUpon
  • Print
  • Add to favorites
  • Digg
  • del.icio.us
  • Twitter
  • Facebook
  • LinkedIn
  • Posterous
  • Slashdot

 

 
eXTReMe Tracker