Im having a rough time with dates in php and mysql, whats the best way to write a query along these lines...
SELECT *
FROM table
WHERE datefield = today
and then
SELECT *
FROM table
WHERE datefield = past 3 days not including today
all my dates are stored in DATETIME format.
Thanks for the help, john
testing datetimes
Moderator: General Moderators
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: testing datetimes
Take a look at this...http://dev.mysql.com/doc/refman/5.1/en/ ... tions.html
You can use the BETWEEN command too.
You can use the BETWEEN command too.
-
pradeep_oscorp
- Forum Newbie
- Posts: 1
- Joined: Wed Apr 01, 2009 2:41 am
Re: testing datetimes
No idea abt ii