To close an open MySQl connection in php, the mysql_close()helps to perform this function. The mysql_close() function is not the necessary part in our program. In non-persistent open links are automatically closed at the end of the script’s execution.
$con=mysql_connect('localhost', 'root', 'test');
echo "connected successfully at:".date("d/m/y : H:i:s", time()) ;<br>}<br>mysql_close($con);
echo "<br />disconnected successfully at:".date("d/m/y : H:i:s", time()) ;
connected successfully at:26/07/10 : 09:31:14
disconnected successfully at:26/07/10 : 09:31:15
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.