mysql_free_result

bool mysql_free_result(mysql result result_handle) 

Frees memory taken up by a result handle.

Returns:

TRUE on success; FALSE otherwise

Description:

mysql_free_result() frees the memory used by a result handle, deleting the result handle in the process. In most cases, this function is unnecessary; PHP’s memory-management system automatically releases the memory used by result handles at the end of the script.

Version:

PHP 3+, PHP 4+

Example:

Free memory used by a MySQL result set
// Pretend that we have made a large query 
// but now we are done with the results and 
// want to free up memory to make another large query 

mysql_free_result ($mysql_result); 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.