Something like this should work.
$today = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
$tomorrow = mktime(0, 0, 0, date("m"), date("d") + 1, date("Y"));
$sql = "SELECT COUNT(*) FROM table WHERE regdate BETWEEN {$today} AND
{$tomorrow}";
$thismonth = mktime(0, 0, 0, date("m"), 1, date("Y")
I want to calculate the registed users today
Also total users this week
Total users this month
Total users this year
The Mysql table has a row of INT(11) with time() value inserted.
I did something like this
$today = strtotime("+1 day")
Then $sql = "SELECT COUNT(*) FROM table WHERE dateReg <= $to