Jump to content

Recommended Posts

Still kind of new to mysql. I'm atm working on a project that I originally paid someone else to write for me, when I knew nothing.

 

One thing I've noticed in the PHP scripts he wrote, is the use of mysql_close($db); near the end of every script which connects to the database. The tutorials I've been learning from so far haven't mentioned this function, but I'd hazard an educated guess that it closes the mysql connection.

 

I'd like to ask, what exactly is the need/purpose for this? Is there a particular need to close connections? Does something happen if I don't? Will connections close themselves anyway after some timeout? Is there anything I haven't asked that I should know about connections?

 

Thank you in advance for any replies.

Link to comment
https://forums.phpfreaks.com/topic/186660-closing-connections/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.