Results 1 to 2 of 2

Thread: Mysql problem

  1. #1
    Join Date
    Oct 2008
    Posts
    60
    Thanks
    2
    Thanked 7 Times in 7 Posts

    Default Mysql problem

    Hello All,
    i am having a HUGE mental block right now. ok here it is.
    i have a database where everthing in it gets displayed.
    |id|product_name|filename|
    1 crap something.ppt

    2. everyday, (1) new product will be added to the database. now i want to display all rows, minus the latest one, because that will be listed above. So here is an example. Say today is the 25th
    [this is one database]

    Todays current news
    Link... <-- 25th statement used (SELECT * FROM db ORDER BY id LIMIT 1)

    Archived News statement used
    (SELECT * FROM db ORDER BY id "SOMETHING FOR MINUS 1")
    ________________________
    crap download <-- 24th
    crap download <-- 23th

    and so forth...

    is there a statement to display all minus the lates entry..
    if this is confusing, please let me know..

  2. #2
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    If it were me I would add a datetime column for the entries.
    Code:
    Select * from tablename order by ID desc limit 1,99999999
    the above sounds like what you are looking for.
    Last edited by james438; 11-11-2009 at 01:15 AM.
    To choose the lesser of two evils is still to choose evil. My personal site

  3. The Following User Says Thank You to james438 For This Useful Post:

    fobos (11-13-2009)

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
  •