I am trying to figure out how I can insert user information only once
(ip,date,browser,referrer) etc... I don't want to have the user information inserted more than once into my mysql database table. Then I want to display it only once every visitor. I have the scripts working fine right now, but it enters and displays every hit to my site regardless if it is unique or not.
My site URL is: http://www.marshalldesigns.com
My site statistics page is : http://www.marshalldesigns.com/viewstats.php

Below is my table in mysql:

CREATE TABLE `statistical` (
`id` int(11) NOT NULL auto_increment,
`ip` varchar(25) NOT NULL default '',
`date` varchar(50) NOT NULL default '',
`subfolder` varchar(65) NOT NULL default '',
`os` varchar(250) NOT NULL default '',
`referrer` varchar(250) NOT NULL default '',

Here is my script used to insert the informaiton into the database:

PHP Code:
$password ""
$host ""
$database ""
mysql_connect($host,$username,$password) or die("Cannot connect to the database.<br>" mysql_error()); 
mysql_select_db($database) or die("Cannot select the database.<br>" mysql_error()); 

$date date("D M j g:ia"); 
$subfolder $_SERVER['PHP_SELF']; 
$referrer $_SERVER['HTTP_REFERER']; 

$result=mysql_query("INSERT INTO statistical (ip, date, subfolder, os, referrer) VALUES ('$ip','$date','$subfolder','$os','$referrer')")or die("Insert Error: ".mysql_error()); 

Thanks, and god bless, I really hope that someone can help me figure out how to place the user only oncel into my database and display only that once not five million of the same person stats. Thanks again.
Steve Marshall

Mr. Marshall