I want to echo number of users registered on my site's admin panel today[counting] and yesterday using PHP.
I am saving their signup date in this format
2017-01-09 20:32:40
After googling i found this
$daterange = "24 HOUR";
$sql = "SELECT COUNT(*)
FROM ad_total_today
WHERE DATE_SUB(CURDATE(),INTERVAL $daterange)
<= FROM_UNIXTIME(date_time)";
$res = mysql_query($sql);
$today = mysql_result ($res, 0, 0);
But I cant seem to understand it.Can anyone help me echo Total number of users registered today and yesterday?