w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Should I $mysqli->close a connection after each page load, if PHP runs via FCGI?

When PHP exits it closes the database connections gracefully.

The only reason to use the close method is when you want to terminate a database connection that you´ll not use anymore, and you have lots of things to do: Like processing and streaming the data, but if this is quick, you can forget about the close statement.

Putting it in the end of a script means redundancy, no performance or memory gain.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.