Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Close MySQL Connection Objects
How To Close MySQL Connection Objects? - MySQL FAQs - PHP Connections and Query Execution
✍: 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);
}
?>
2007-05-10, 5329👍, 0💬
Popular Posts:
What are urlencode() and urldecode() functions in PHP? string urlencode(str) - Returns the URL encod...
Can you explain the fundamentals of “GetGlobalResourceObject ”and “GetLocalResourceObject” function...
What will be printed as the result of the operation below: main() { int x=10, y=15; x = x++; y = ++y...
1. What is normalization. 2. Difference between procedure and functions. 3. Oracle 9i Vs 10g. 4. how...
How can we know the number of days between two given dates in PHP? Simple arithmetic: <?php $...