PHP Classes
elePHPant
Icontem

File: sample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Sreedev R  >  Rapid MySQL  >  sample.php  >  Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: Sample code
Class: Rapid MySQL
Cache the results of MySQL queries in files
Author: By
Last change:
Date: 3 years ago
Size: 718 bytes
 

Contents

Class file image Download
<?php
   $mtime
= microtime();
  
$mtime = explode(" ",$mtime);
  
$mtime = $mtime[1] + $mtime[0];
  
$starttime = $mtime;
;
?>
<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
require_once 'class.rapidMysql.php';
 
$db = new rapidMysql('root','','localhost');
 
$db->SelectDB('sassy');
 
$db->cache = true;
 
$db->cache_life = 2000;
 
$result = $db->Query("SELECT * FROM `afc_product`");
 echo
'<pre/>';
 
print_r($result);
 
?>
<?php
   $mtime
= microtime();
  
$mtime = explode(" ",$mtime);
  
$mtime = $mtime[1] + $mtime[0];
  
$endtime = $mtime;
  
$totaltime = ($endtime - $starttime);
   echo
"This page was created in ".$totaltime." seconds";
?>