db_free_result From Online Manual

Revision as of 16:00, 4 November 2012 by Yoshi2889 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Usage:

$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.

Parameters:

  • result a query resource as returned by db_query.

Return: will return the exact same results as mysql_free_result.

Example:

// Grab a result from the database.
$result = $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.
$smcFunc['db_free_result']($request);



Advertisement: