is it necessary to use mysql_close() at the end of a query in PHP?
No. When the PHP requests ends all resources will be freed, including MySQL connection resources.