mysql + PHP - use or not use mysqli_close()

Asked

Viewed 854 times

4

I just noticed I’m not using the function mysqli_close() indicated on the website of PHP.NET

I monitor the connections through Workbench client conections and there are open connections, my doubt is whether that way I am programming without using this function I am prone to some kind of problem in the future type fulnerability, error, or some other kind of problem ?

  • Your connection will be open.

  • Workbench does not show open connections

  • So good. It’s over.

1 answer

6


Connections that are not persistent close themselves at the end of the script in the theory you don’t need to close it.

But if your script takes too long to run, it is interesting that you close the connection after using it to not hold it open while the script runs.

This is also good when your server has a limited number of database connections.

  • then there is no problem beyond these issues of limited connections in BD ?

  • Apart from these questions I said no, if the script is delivered quickly you should not have problems.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.