dsbx40787736 2013-07-18 19:23
浏览 20

服务器没有正确缓存sql结果

Here is the code in an ajax php file. It checks the memcache to see if the results have already been stored, and then if not it looks them up in the DB. I have this code deployed on 2 identical servers. On one server it works fine, on the other it never finds anything in the cache. Thanks in advance.

$res = $_SESSION['memcache']->get($key);
if($res === false or sizeof($res)<1){
   $res = $this->dbconn->fetch_json_grid_obj($sql,true,array("Curr Ext",
   date("M Y",mktime(0,0,0,date('m')-1,1,date('Y')))." Ext"));
   // cache until 7am
   $_SESSION['memcache']->set($key, $res, 0, strtotime(date('Y-m-d 
  H:i:s',mktime(7,0,0,date('m'),date('d')+1,date('Y')))));
  }

Very strange!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 2024-五一综合模拟赛
    • ¥15 下图接收小电路,谁知道原理
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭