memcached - php memcache not working with mvc -


I have two different controllers. I am working with Zend Framework MVC

Controller 1 Set up the data

Controller 2. Get the data and display

so I just do it:

Controller 1. $ memcache = new mail; $ Memcache- & gt; Connect ('localhost', 11211) or die ("could not connect"); $ Data = array ('id' => 1, 'name' = & gt; 'jones'); $ Key = "PersonalDetail"; $ Memcache- & gt; Set ($ key, $ data, MEMCACHE_COMPRESSED, 1200);

Controller 2.

  $ memcache = new mail; $ Memcache- & gt; Connect ('local host', 11211) or die ("could not connect"); $ Key = "PersonalDetail"; $ Data = $ memcache-> Get ($ key); Var_dump ($ data); // is not getting anything   

I have checked the key if it is set or not and I find that it is set to controller 1 but when I run the controller2 code And then check the key..I was not there.

Is this happening because I am connecting Memkesh again to get the data?

Memcheck keys can not contain spaces, set keys on personal_detail . See:

The data stored by memcached is identified with the help of a key. A key is a text string, which should identify the data specifically for customers who store and retrieve it. Interested in doing. At present, the length limit of a key is set to 250 characters (of course, customers usually do not need to use such long keys); The key should not include control characters or white space.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -