I want to check if a device's IP has been stored before, if so, check if IP storage time and now() is greater than 10min and do stuff.
here's my PHP to cheeck if IP is present in the database.
$ip = mysql_real_escape_string($_SERVER['REMOTE_ADDR']);
$query = "SELECT * FROM messages WHERE ip = '$ip'";
$result = mysql_query($query);
if (mysql_num_rows($result) > 0) {
echo "IP Present..";
}
I have a column in the database named messageTime which stores the time when an IP gets stored.