get('stats_browser')) ) { ob_start(); $select = sprintf('SELECT name, hitcount FROM browser_stats'); $res = do_mysql_query($select); //What if table hasn't got any data if( mysql_num_rows($res) == 0 ) { $sql = "INSERT INTO browser_stats VALUES ('MSIE',0), ('Mozilla', 0), ('Firefox', 0), ('Opera', 0), ('Lynx',0), ('Konqueror',0), ('Other',0)"; do_mysql_query($sql); } $arr = array(); while($inf = mysql_fetch_assoc($res)) { $arr[ $inf['name'] ] = $inf['hitcount']; } $tot = array_sum($arr); echo ''; while( list($name,$hitcount) = each($arr) ) { echo ""; } //echo "
".$name." ".(round($hitcount*100/$tot))." %
"; echo ''; $stats = ob_get_clean(); $cache_lite->save($stats, 'stats_browser'); } echo $stats; ?>