SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,033
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    How do you issue SELECT to select items posted in last X seconds?

    Hello,

    How do you issue SELECT to select items posted in last X seconds?
    For example for last 60 Seconds.
    I have tried this:

    SELECT * FROM xyz
    WHERE ip = '$ip'
    AND date_added > (DATE_SUB(CURDATE(), INTERVAL 60 SECOND))
    ORDER BY id DESC;


    But this does not return correct results as the list that it returns is not limited to last 60 Seconds but more like 20 Hours or so!!!

    Thanks.

    Anoox search engine volunteer

    www.anoox.com

  2. #2
    SitePoint Wizard WorldNews's Avatar
    Join Date
    Nov 2007
    Posts
    1,033
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Please ignore this Question.
    I found the answer to it already.

    Anoox search engine volunteer

    www.anoox.com

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,338
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    what was it? because that sql looks okay to me
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •