Results 1 to 2 of 2

Thread: Only show items upto 3days old

  1. #1
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Only show items upto 3days old

    Hi am trying to make a page that will show the last 3 days of news.

    however i am not sure how to limit it to only show items that are newer then 3 days.

    the dates are stored in the database like 2008-08-10 14:05:01 under the row date_time

    Any help would be great
    The web in one word.

  2. #2
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I played around with it and got it to work... If any one needs to know how to do it here is a sample it may not be the best way to do it but it works...

    $query = "SELECT * FROM news WHERE date_time BETWEEN CURRENT_DATE-3 AND CURRENT_DATE ORDER BY id DESC";
    The web in one word.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •