Home > Archive > MySQL Server Forum > November 2005 > Unixtime SQL Help









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Unixtime SQL Help
Dan

2005-11-22, 8:23 pm

I'am having problem with the SQL statement...

MySql Database Table structure for phpnews_news is
id int unsigned auto_increment primary key,
posterid int,
postername char(40),
time int,
etc ......

The Time column is populated using a php time() function.

How do I use the TIME column to give me only the last 7 days worth of
data. Not sure how to manipulate unixtime formats... any help would be
appreciated..

SELECT * FROM PHPNEWS_NEWS where time between
DATE_SUB(CURDATE(),I
NTERVAL 30 DAY) and curdate()

Any help would be appreciated...

Dan

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com