I want to limit my query to results that have been entered in the last 10 days. The TIMESTAMP column is called Date. How do I do it?
$result = mysql_query("SELECT * FROM Posts WHERE (City = '$city2') ORDER by Comments DESC LIMIT 5");
Thanks
I want to limit my query to results that have been entered in the last 10 days. The TIMESTAMP column is called Date. How do I do it?
$result = mysql_query("SELECT * FROM Posts WHERE (City = '$city2') ORDER by Comments DESC LIMIT 5");
Thanks
Assuming your data is hourly can also use:
(SELECT * FROM comments ORDER BY DateTime desc LIMIT 240) order by DateTime
I found this to be more exact in returning exactly 10 days to the hour.