2018-06-12, 01:48 PM
Hi,
I have a rather simple query and I would like to cache it:
but I have no idea how the cache works and when or how to update the cache.
Would appreciate if some one could post some sample code based on my sample.
Thanks in advance...
I have a rather simple query and I would like to cache it:
$container = '';
$altbg = alt_trow();
$content = '';
$query = $db->query("
SELECT id, name, thumbnail
FROM ".TABLE_PREFIX."directory
WHERE m.hidden=0
ORDER BY m.name"
);
while($list = $db->fetch_array($query))
{
$list['cid'] = $list['id'];
$list['list'] = htmlspecialchars_uni($parser->parse_badwords($list['name']));
if(my_strlen($list['name']) > 25)
{
$list['list'] = my_substr($list['name'], 0, 25) . "...";
}
$list['cover'] = $list['thumbnail'];
eval("\$content .= \"".$templates->get("directory_content")."\";");
$altbg = alt_trow();
}
if($content)
{
eval("\$container = \"".$templates->get("directory_container")."\";");
}
but I have no idea how the cache works and when or how to update the cache.
Would appreciate if some one could post some sample code based on my sample.
Thanks in advance...