The mysqli_close() function closes a previously opened database connection. This is a crucial step for
releasing memory on the server.
EXAMPLE
RESULT
The result will be displayed here...
Practical use: Although PHP automatically closes connections at the end of script execution, it
is good programming practice to close them manually as soon as the database is no longer needed.
Close the connection at the end of the file or immediately after the last query.
This prevents overloading the MySQL server when experiencing a high number of visitors.
Once the connection is closed, you can no longer execute queries until a new one is established.
We use cookies to ensure a better user experience and website functionality.