This is my code:
$ip = getenv ("REMOTE_ADDR");
$query = mysql_query("SELECT * FROM ldu_ips WHERE ips_ip = '".$ip."'");
$numrows = mysql_num_rows($query);
if ($numrows == 1){
echo "You have already voted today!";
}
else if ($numrows == 0){
mysql_query("UPDATE ldu_toplist SET toplist_in = toplist_in + 1 WHERE toplist_id = '".$id."'");
mysql_query("INSERT INTO toplist_ips (ips_ip) VALUES('".$ip."');");
}
It will insert the IP into the database yet, when the IP is already in the database, it stills adds 1...anyone see where I went wrong?