Simple PHP Date Comparison
Posted: Thu Mar 27, 2008 11:29 pm
Hi,
I'm very new to PHP. I'm trying count the number of registrations today and display in the web page. Below is the code I'm using but I'm unable to compare:
The date is the mysql database is stored as
its returning 0 but there are 2 registrations. So there is a logical error. I'm using the date functions here: http://sg2.php.net/date for reference.
Any ideas?
Thanks in advance.
I'm very new to PHP. I'm trying count the number of registrations today and display in the web page. Below is the code I'm using but I'm unable to compare:
The date is the mysql database is stored as
Code: Select all
2008-03-27 21:09:41Code: Select all
$today = date("Y-m-d H:i:s");
$resultCount = mysql_query("SELECT count(*) FROM users WHERE registerDate='$today' ");Any ideas?
Thanks in advance.