I am creating a users online script and I need to be able to compare IP addresses. However, when an IP address is added to the db it only uses the first set of numbers of it. (127 of 127.0.0.1 in my case) When I print $user_ip it appears as 127.0.0.1, but in the db it's only 127. Whats wrong? 🙁
$user_ip = $REMOTE_ADDR; // IP address variable
$insert_query = "INSERT INTO {$db_table} (ip, timestamp) VALUES ('{$user_ip}', '{$timestamp}')";
if (mysql_num_rows(mysql_query($exists_query)) == 0) {
mysql_query($insert_query);
}