SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2001
    Location
    Palm Desert, California
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Selecting Date Range

    I am trying to display a list of names that will be expiring in the next 30, 60 or 90 days. It works fine except it also shows the names that have already expired. I don't want it to show expired names just what is expiring in the future. The code below displays what is expiring in the next 30 days.

    PHP Code:
    $result mysql_query("SELECT name, expiration FROM domains
           WHERE expiration <= Now() + interval 2592000 second
           ORDER BY expiration"
    ); 
    Thanks

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,016
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    WHERE expiration > Now()
    AND expiration <= Now() + interval 2592000 second

    rudy

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2001
    Location
    Palm Desert, California
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hahah I knew it was going to be something simple.. I guess I was having a brain fart..

    Thanks Rudy..


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
  •