PHP MySQL Connection CloseTo close a mysql connection we can use mysql_close() function. It can takes a optional parameter as link and closes it. If no link identifier is specified then last opened connection is closed. It is not necessary to use mysql_close() function as all connections are closed at the end of the script execution. Here is the function
Note that mysql_close() will not close persistent connection created by using mysql_pconnect()
Example of MySQL connection, query execution and closing connectionThe sequence is to first connect to MySQL database , then mange the database and finally close the connection.
Subscribe to our YouTube Channel here
This article is written by plus2net.com team. https://www.plus2net.com
More on PHP MySQL functions