db_free_result From Online Manual

Revision as of 15:55, 4 November 2012 by Yoshi2889 (talk | contribs)
Jump to: navigation, search


$smcFunc['db_free_result'] (result)

Description: Frees the memory in use by the result from a query. Works exactly as mysql_free_result. This is usually called after the data has been fetched from the database.


  • result a query resource as returned by db_query.

Return: will return the exact same results as mysql_free_result.


$result =// Grab a result from the database.
 $smcFunc['db_query']('', '
	SELECT something
	FROM {db_prefix}a_table', array());

// Fetch the data from it.
$array = array();
while ($data = $smcFunc['db_fetch_assoc']($result))
	$array[] = $data;

// Then free the result.