Php Memcached结果=0

Php Memcached结果=0,php,memcached,Php,Memcached,我从我的源代码中得到了这段代码 if ($where != "") $where = "WHERE $where"; $res = $mysqli->query("SELECT COUNT(id) FROM torrents $where LIMIT 1") or die(mysql_error()); $row = mysqli_fetch_array($res); $count = $row[0]; 我试过了这是corect吗 if ($where != "")

我从我的源代码中得到了这段代码

if ($where != "")
        $where = "WHERE $where";

$res = $mysqli->query("SELECT COUNT(id) FROM torrents $where LIMIT 1") or die(mysql_error());
$row = mysqli_fetch_array($res);
$count = $row[0];
我试过了这是corect吗

 if ($where != "")

        $where = "WHERE $where";
    $ress = $mysqli->query('SELECT COUNT(id) FROM torrents $where LIMIT 1';) or die(mysql_error());
$nombre ='details'.$ress;
$res = mysqli_query($ress);
$count = array();
while($count = mysqli_fetch_array($res)) $rows[] = $count;
$memcache->set($nombre, $count, 1);
结果“抱歉,找不到pal”


我的问题解决了吗。。您的表中没有数据
if ($where != "")
      $where = "WHERE $where";
  $res = mysql_query("SELECT COUNT(id) FROM torrents $where LIMIT 100") or die(mysql_error());
$key = md5($res);
$get_data = $memcache->get($key);

if($get_data) {
 echo 'Data Pulled From Cache';
} else {
   while ($row = mysql_fetch_array($res)) {
       $memcache->set($key, $res, TRUE, 3600); 
       $count = $row[0];
 }
}