Login   Register  
PHP Classes
elePHPant
Icontem

File: Example2.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ivan Priorov  >  keeper  >  Example2.php  >  Download  
File: Example2.php
Role: Example script
Content type: text/plain
Description: Example file
Class: keeper
Store and retrieve keys in array static object
Author: By
Last change:
Date: 2010-10-31 09:31
Size: 299 bytes
 

Contents

Class file image Download
<?php
require_once 'Keeper.php';
/*
 * The repetitive requests to the database...
 */
$query "SELECT * FROM `users` WHERE `id`=12";
$key md5($query);
if (
Keeper::exists($key)) {
    
$array Keeper::get($key);
} else {
    
$array mysql_fetch_assoc(mysql_query($query));
    
Keeper::set($key$array);
}