AJ OP AJ OP - 2 months ago 7
SQL Question

How to SELECT data from table which recorded today?

Use PHP and MySQL. In my table, there is date field (datetime) recorded by NOW() sql function. Example value of data in this field is 2010-10-07 10:57:36. How can I SELECT all data which day-month-year is today. I try to use code as below:

SELECT * FROM table WHERE date=????

Answer

SELECT * FROM table where DATE(date)=CURDATE()

Comments