MySQL MySQL Database Connection

Do I need to explicitly close the database connection after the query (and another database operation)?

+3
source share
4 answers

Not unless you are sure you have completed a database connection to run the script. Even then, you do not need to explicitly close it, because PHP does this automatically after the script completes, if you are not using mysql_pconnect()to connect to your database.

+2
source

No, php does this automatically. You might call it “good programming practice” to clear (also close mix).

+3
source

, , . , API, , , (, PDO), , , .

+3

php , , , db max_connections . .

,

open conn con

Because slow devices will not depend on your connections.

0
source

Source: https://habr.com/ru/post/1755897/


All Articles