Re: [PHP-DB] Date calculation from MySql table

2008-04-12 Thread Evert Lammerts
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")

[PHP-DB] Date calculation from MySql table

2008-04-12 Thread A. Joseph
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