An example of using the template for output buffering + database extraction and display
Source: Internet
Author: User
? Php // This is a simple cache example: // on this page, you need to extract N records from several tables to display them. Because database operations are frequent, // The cache method is used, the value remains unchanged within 24 hours. if the value is exceeded, it is regenerated. // This example also uses the template function to generate pages. // There are two methods to generate records immediately in this article.
// This is a simple cache example:
// On this page, N records need to be extracted from several tables and displayed immediately, because database operations are frequent,
// Therefore, the cache method is used. if the value is exceeded within 24 hours, it is regenerated.
// This example also uses the template function to generate pages.
// There are two methods to generate records immediately in this article to adapt to the continuous and discontinuous index IDs, respectively,
// It is for reference only. For more information, see.
// Steeven@kali.com.cn
// Cache File name:
$ Cache_file = 'index. Inc ';
If (time ()-filemtime ($ cache_file) <3600*24 ){
// If the modification time of the cached file does not exceed 24 hours
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.