이 내가 phpfastcachephpfastcache 사용 방법은 무엇입니까?
$shorting = $conn->prepare("SELECT text,time FROM small WHERE active='0' ORDER BY time DESC LIMIT 10");
$shorting->execute();
while($obj = $shorting->fetch(PDO::FETCH_OBJ)){
<div id="lastnews_title">
<div><?php echo $obj->text; ?></div>
<div style="text-align:left">
<?php echo timeTonow($obj->time); ?>
</div>
이 함께이 쿼리를 캐시하려고
index.php 파일에서 내 주요 질의는
// Require Library
require_once("../phpfastcache/phpfastcache.php");
// simple Caching with:
$cache = phpFastCache();
// Try to get $products from Caching First
// product_page is "identity keyword";
$products = $cache->get("product_page");
if($products == null) {
$products = "DB QUERIES | FUNCTION_GET_PRODUCTS | ARRAY | STRING | OBJECTS";
// Write products to Cache in 10 minutes with same keyword
$cache->set("product_page",$products , 600);
}
// use your products here or return it;
echo $products;
난에 require_once("../phpfastcache/phpfastcache.php");
쓰기 phpfastcache 사이트의 예입니다 내 index.php
이 캐시 클래스에 내 쿼리를 삽입하는 방법을 모릅니다?
이 코드가 기능처럼 보이지 않는
$shorting = $conn->prepare("SELECT text,time FROM small WHERE active='0' ORDER BY time DESC LIMIT 10");
$shorting->execute();
while($obj = $shorting->fetch(PDO::FETCH_OBJ)){
PHP 문이 세트를 둘러싼 <php>
태그 집합이없는, 내가 그 생각 나쁜 영어