I want to get the count of visits from current IP address in last 2 minutes. This is the code I have tried, but the result is always zero. Screen shot of my table is attached. I have tried without prepared statement, it is also returning zero
<?php
$ip=$_SERVER['REMOTE_ADDR'];
$stmt = $con->prepare('SELECT * FROM visitors_activity where ip=? and visit_time > date_sub(now(), interval 2 minute) ');
$stmt->bind_param('s',$ip);
$stmt->execute();
$result = $stmt->get_result();
echo $result->num_rows;