public function __construct() { if( class_exists('Memcache')) { $this->MEM = new Memcache; if( !$this->MEM->connect('localhost', 11211) ) { $this->NO = 1; } } else { $this->NO = 1; } self::$QUERY_COUNT = array( 'blank' => 0, 'get' => 0, 'set' => 0, 'total' => 0 ); }
while( $row = mysql_fetch_assoc( $sql ) ) { echo $row['name'].' '.$row['surname']; } ?> <? // After // Initialize class include('mysimplecache_class.php'); $A = new MySimpleCache(); $sql = "SELECT name, surname FROM users "; $sql = $A->mysql_query( $sql ); while( $row = $A->mysql_fetch_assoc( $sql ) ) { echo $row['name'].' '.$row['surname']; } ?>