mysql_close
(PHP 4, PHP 5)
Close MySQL connection
Note mysqli_closePDO: Assign the value of null to the PDO object
Description
mysql_close() closes the non-persistent connection to the MySQL server that's associated with the specified link identifier. If link_identifier isn't specified, the last opened link is used.
Sets
Parameters
Return Values
Success
Examples
mysql_close() example
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>The above example will output:
Connected successfullyNotes
mysql_close() will not close persistent links created by mysql_pconnect(). For additional details, see the manual page on persistent connections.