The following code allows me to count the total number of visits that are registered by IP
:
$stmtIP = $con->prepare("SELECT COUNT(*) FROM visitor_ip WHERE ip_remote=?");
$stmtIP->bind_param("s",$IP_ADDRESS);
$stmtIP->execute();
$count_ip_record = null;
$stmtIP->bind_result($count_ip_record);
$stmtIP->fetch();
$stmtIP->close();
echo $count_ip_record;
I have a column in the data table called: visitor_date
of type datetime
, records a:
2021-01-18 19:40:15
Which I want to count the IP
records by current date. How can I pass that condition to WHERE
?