Intro to Databases - Freeing the Results and Closing Down
(Page 7 of 8 )
Almost finished. Only thing left is to release the results of the queries and closing the connection to the database.
Natively
To release the results and close the connection is quite simple. Simply call the mysql_free_results() function and then call the mysql_close() function. That is all - nothing else.
<?php // notice that the variable is the one holding the connection to the actual results mysql_free_result($result); // notice that the variable is the one returned after we selected the database mysql_close($link); ?>
PEAR DB
This is done just as easily as the native functions - so relax. To free the results from the query just call the free method from the DB_result class and then call the disconnect method from the DB class. After that - your done. Congratulations.