I want to record the refering site to a db to see where people are coming from. I am using this to find the referer
Code: Select all
<?php
$refer = $_SERVER['HTTP_REFERER'] ;
?>
and this to store the info to the database, which works as expected.
Code: Select all
<?php
if ( !isset($refer) == true) {$refer = 'Bookmark or Other'; }
$refer = "INSERT INTO stats_referer(referer) VALUES ('$refer')";
$result = mysql_query($refer, $skinz);
?>
This will currently create a new line in the database even if the referer already exists. How do I alter this to update a column called hits if the referer already exists in the database