Ok, getting there. But it still doesn't work. Do you think my modified version will do it?
$ipaddress=$_SERVER['REMOTE_ADDR'];
$ip_query = @mysql_query("SELECT * FROM visitor_log WHERE ipaddress = '$ipaddress'");
if (mysql_num_rows($ip_query) >0 {
$query1="UPDATE visitor_log SET action = '1' WHERE ipaddress='$ipaddress'";
mysql_query($query1) or die('Database Query Error: '.mysql_error());
}
mysql_close($db1)
Or, do I even need to have the if statement and just have the entire code as this:
$ipaddress=$_SERVER['REMOTE_ADDR'];
$query1="UPDATE visitor_log SET action = '1' WHERE ipaddress='$ipaddress'";
mysql_query($query1) or die('Database Query Error: '.mysql_error());
mysql_close($db1)
Would that work? If the ipaddress is not in the database, nothing happens. Otherwise, it puts '1' in the action field? Would I need to suppress errors if no ipaddress is found in the database?
Also notice I changed the if statement to >0 so that it works correctly!