It's unclear from your code sample how you are instantiating the memcache
class instance. Meaning, $memcache isn't set? Try this:

$memcache = new Memcache;
$memcache->connect('127.0.0.1', 11212);
$memcache->set('sample3',2);
$foo = $memcache->get('sample3');
print_r( $foo );




On Sun, Jun 5, 2011 at 7:11 PM, Aditya Kumar <adityakumar...@yahoo.com>wrote:

> =========
>
> The same thing I am trying to retrive from php:
>
> output is
> ====
> NULL
>
> Code I am using in PHP us :
> $memcache->connect("127.0.0.1",11212 );
> print_r($memcache->get("sample3"));
>
> I am not sure what I am missing in php that it is not printing/retriving
> the data.
>

Reply via email to