I m trying to use memcache but I m stuck on a small part. I ve got a function that gives in result an array of several things (most of them being strings), and one of them is the result of the mysql_query() function. Here is how I am trying to unserialize:
$posts_count = my query;
/* MEMCACHE KEY GEN*/
$memcache_key = md5($posts);
$pagination = memcache_get($memcache, $memcache_key);
if($pagination==NULL) {
echo NOT CACHED ;
$pagination = (the function that will call mysql_query)
//SAVE A SERIALIZED VERSION OF THE ARRAY
$memcache->set($memcache_key, serialize($pagination), 0, 3600);
}
else {
$pagination = unserialize($pagination);
}
//THIS IS ONLY THE RESULT OF mysql_query!!!
$posts = $pagination[result];
while($var = mysql_fetch_array($posts)) { ... stuffs here }
在我sql_fetch_array之前如何“拯救”我sql_query的这种结果? 或者说,在 lo期间,如何使用肉类打上整个东西?