You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2022-05-03 15:08:14

lucaszephyr
Member
Registered: 2022-04-25
Posts: 29

Close database connection

Does glpi have some function that closes the connection to the database?
something like "mysqli->close;"

Or it closes that connection on its own?

Offline

#2 2022-05-04 12:37:10

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,814
Website

Re: Close database connection

There is an explicit connection closing done after the page footer is displayed but the PHP extension would handle closing any hanging connections at the end of script execution as they are not persistent connections.

The PHP documentation on the close method explains this process:
https://www.php.net/manual/en/mysqli.close.php


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#3 2022-05-06 16:17:22

lucaszephyr
Member
Registered: 2022-04-25
Posts: 29

Re: Close database connection

After some research I found that there are two methods. The first using "$DB->close();" and the second using "closeDBConnections();". Don't forget to request the "includes.php" in inc

Offline

Board footer

Powered by FluxBB