-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
db.close? #2
Comments
The link you posted above is in reference to mysql_close(), not to be confused with mysqli_close(); In regards to mysql_close();
http://php.net/manual/en/mysqli.close.php <- mysqli_close is however not depreciated. Always double check that your looking at the mysqli documentation instead of the depreciated mysql documentation.. To answer your question, you do not have to explicitly close the connection by calling mysqli_close() as the connection will be automatically destroyed when the script has completed execution. If you're developing an app that will be used in a limited resource environment, than it's not a bad idea to explicitly close the connection manually via mysqli_close() as soon as possible to free up resources. On a side note, mysqli_close() will not close persistent connections. Hope this helps... |
@geeShoe Ah fair enough. Yeah thanks for the explanation. |
Hey thanks for making this. I wanted to ask if you also should make a function that could close the connection?
f.x. here:
http://php.net/manual/en/function.mysql-close.php
The text was updated successfully, but these errors were encountered: