When you have finished using a database, you should close the connection. This is done by issuing the command :
<?php mysql_close($db_server); ?>
All database connections are automatically closed when PHP exits, so it doesn’t matter that the connection wasn’t closed in programs.
But in longer programs, where you may continually open and close database connections, you are strongly advised to close each one as soon
as accessing it is complete.