I make this observation: // why this???
echomc(); // this give error … if commented and uncomment next line Not error
//echo memcache_get($memcache_obj, ‘var_key’);
Warning: memcache_get() expects parameter 1 to be MemcachePool, null given in /var/sites/b/xyz.com/public_html/xyz.php on line 45
[php]/* procedural API */
/* connect to memcached server */
$memcache_obj = memcache_connect(‘x.y.z.f’, 11211);
/*
set value of item with key ‘var_key’
using 0 as flag value, compression is not used
expire time is 30 seconds
*/
memcache_set($memcache_obj, ‘var_key’, ‘some variable’, 0, 30);
function echomc() {
echo memcache_get($memcache_obj, ‘var_key’); // line 45
}
echomc(); // this give error … if commented and uncomment next line Not error
//echo memcache_get($memcache_obj, ‘var_key’);[/php]