View Single Post
02-23-2007, 07:45 PM
#43
Xi0s is offline Xi0s
Status: Sin Binner
Join date: Dec 2006
Location: Huddersfield, UK
Expertise:
Software:
 
Posts: 384
iTrader: 3 / 83%
 

Xi0s is on a distinguished road

Send a message via MSN to Xi0s

  Old

<?php
include("config.php");
session_start();
if(!isset($_SESSION['hits'])){
$select = mysql_query("SELECT * FROM `table` WHERE ID = '1'");
$query = mysql_fetch_assoc($select);
$_SESSION['hits'] = $query['hits'];
$_SESSION['hits']++;
mysql_query("UPDATE `table` SET hits = ".$_SESSION['hits']." WHERE ID = '1'");
}
?>

Put that into each page and it will count unique hits beautifully .