As long as you are not specifically using a persistent connection (e.g. mysql_pconnect()), then the connection will be automatically closed when your script terminates. So normally you do not really need to worry about it, but if a given script could be expected to take some non-trivial amount of time to complete after it's done with all its database access, it would probably be a good idea to close the connection when done with it in case you get enough traffic where you might run out of available connections.