Jump to content

Closing Connections


WarKirby

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.