Jump to content

memcache


abdfahim

Recommended Posts

Hi,

 

i want to store a mysql result resource in cache using MEMCACHE. I can store using following code, but I can't retrieve result variable from cache. Anyone can help please?

      $memcache = new Memcache;
      $memcache->connect("localhost",11211) or die ("Could not connect");

      include ("dbcon.php");
      $key="aa";
      $sql = "select * from login_table";
      $qry = mysql_query($sql) or die(mysql_error());
      $result = mysql_fetch_object($qry);
      $memcache->set($key,$result,0,360);

Link to comment
https://forums.phpfreaks.com/topic/137495-memcache/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.