Collections:
Close MySQL Connection Objects in MySQL
How To Close MySQL Connection Objects in MySQL?
✍: FYIcenter.com
MySQL connection objects created with mysql_connect() calls should be closed as soon as you have finished all of your database access needs by calling mysql_close($con) function. This will reduce the consumption of connection resources on your MySQL server.
If you forget to call mysql_close(), PHP engine will automatically close your connection objects, when your PHP script reaches the end. The following PHP script shows a good example of mysql_close():
<?php
$con = mysql_connect('localhost:8888', 'dev', 'iyf');
if (!$con) {
print("There is a problem with MySQL connection.\n");
} else {
print("The MySQL connection object is ready.\n");
mysql_close($con);
}
?>
⇒ List All Existing Databases in MySQL
⇐ Retrieving MySQL Server information in MySQL
2017-11-11, 3213🔥, 0💬
Popular Posts:
Why I Can Not Enter 0.001 Second in DATETIME values in SQL Server Transact-SQL? If you enter millise...
How to format a number of bytes in a human-readable unit using the FORMAT_BYTES() function? FORMAT_B...
How To Convert Binary Strings into Integers in SQL Server Transact-SQL? Binary strings and integers ...
How to obtain the number of rows found by the last SELECT statement using the FOUND_ROWS() function?...
Where to find answers to frequently asked questions in general areas of Microsoft SQL Server Transac...