I have two problems with this code
1/ Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/site.com/httpdocs/counter2.php on line 11 (line 11 starts $row = mysql
2/ it does not stop adding my IP evertime i goto the page...
connect stuff
$newIP = $_SERVER['REMOTE_ADDR'];
$self = $_SERVER['PHP_SELF'];
$time = time();
$result = mysql_query ("SELECT * from counter where IP = $newIP");
$row = mysql_fetch_array($result);
$timestamp = $row["timestamp"];
if ($timestamp >= $time - 600)
{
exit();
} else {
$result2 = mysql_query ("INSERT INTO counter (`id`,`IP`,`page`,`timestamp`) Values ('','$newIP','$self','$time')") or die("INSERT error: ".mysql_error());
}
?>