PHP & SQL - get results from db where date is today
i'm trying to do the following thing: In my Database, I have rows with
time in each one (using time() function). For example: 1380300397. Now,
I'd like to build a query that gets the rows from the current day. I've
tried this query with no success:
SELECT `id`,DATE_FORMAT(`time`, '%Y-%m-%d') FROM `facts`
WHERE `app` = 1 AND DATE(`time`) = CURDATE()
What am I doing wrong? Thanks!
No comments:
Post a Comment