Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

closing connection

Status
Not open for further replies.

beco73

Programmer
May 8, 2005
157
CA
Hi,

Like in many database MSDE, SQLSERVER etc, once you are done with database you close the connection

Conn.close
Set Conn = Nothing


Do we do any such thing in MYSQL?

Thanks
 
You should, yes. Depending on the tool you are using, it is more or less important. Perl, for example, will close the MySQL connection for you even if you don't at the end of the script. But maybe another tool won't, and you will have a dangling connection. So yea, close it.
 
I am using PHP, how do you do that, do you know the code?

Thanks
 
A further comment on this - according the abovementioned link from my previous post, PHP will clean up non-persistent links itself, so you need not do an explicit mysql_close().
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top