I am using a while loop to diplay the contents of an table:
while ($row = @mysql_fetch_array($query))
Each row has a cell that carries the date. How can I make it only display the last 30 days worth of rows?
As always, Thanks for the help :)
mavherick
9:44 pm on Dec 13, 2002 (gmt 0)
Well it all depends on the format of your date field. I personally use the unix time since 1970 thingy (number of seconds since 1970), and if you also do you could build your sql query like this:
SELECT * FROM yourTable WHERE date > $timeLimit
$timeLimit would be number of second since 1970 at runtime minus 30 days worth of second.