AJ OP AJ OP - 1 year ago 75
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 Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download