86400*40 ); // backend options $backendOptions = array( 'cache_dir' => 'cache' // Directory where to put the cache files ); // make object $cache = Zend_Cache::factory('Output','File', $frontendOptions,$backendOptions); // make an id $cacheID='hotel_cn_7033632'; // everything before this is not cached if (!($cache->start($cacheID))) { // begin cache include($_SERVER['DOCUMENT_ROOT'].'/dbinfo.inc.php'); $mysqli=mysqli_connect('localhost',$username,$password,$database); mysqli_set_charset($mysqli,"utf8"); if (mysqli_connect_errno($mysqli)) { trigger_error( 'Database connection failed: ' . mysqli_connect_error(), E_USER_ERROR); } $query1="SELECT hotel_id from facilities8 WHERE hotel_id ='7033632'"; $result1 = mysqli_query($mysqli, $query1); $num1=mysqli_num_rows($result1); $query="SELECT * FROM ahotels_chin LEFT JOIN ahotels ON ahotels_chin.hotel_id = ahotels.hotel_id LEFT JOIN ahotels_img ON ahotels_chin.hotel_id = ahotels_img.hotel_id LEFT JOIN descriptions_chin ON ahotels.hotel_id = descriptions_chin.hotel_id "; if ($num1 == 1) { $query .= "LEFT JOIN facilities8 ON ahotels.hotel_id = facilities8.hotel_id "; } $query.= "LEFT JOIN agoda_cities ON ahotels.city_id = agoda_cities.city_id WHERE ahotels.hotel_id ='7033632' LIMIT 1" ; $result = mysqli_query($mysqli,$query) or trigger_error("Query Failed! SQL: $query - Error: ". mysqli_error($mysqli), E_USER_ERROR); while($row = mysqli_fetch_assoc($result)) { include($_SERVER['DOCUMENT_ROOT'].'/variables_chin.php'); include($_SERVER['DOCUMENT_ROOT'].'/fluidhotel9_chin.min.php');} // end cache $cache->end(); } // everything after this is not cached ?>