“Smart” Caching System using PDO and Memcache
问题 I am working on a "smart" caching system that uses pdo and memcache. However, I am stuck at this error. Can you help me out? My Code: $session = "a121fd4ztr6"; cache_query("SELECT * FROM `session` WHERE `session` = :session: LIMIT 1;", array(':session:' => $session)); // CACHE QUERY function cache_query($sql, $params) { global $db; global $memcache; $name = 'querycache-'.md5(serialize(array($sql, $params))); $result = $memcache->get($name); if (!$result) { if(!($db)){ require("db.php"); }