Once the Database will be closed the script ends automatically. To close the connection before, use the mysql_close() function.
HTML Code:
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// some code
mysql_close($con);
?>