WEB mysql masters: reversing list of IDs on a table

Discussion in 'OT Technology' started by BoostedBoogie, Dec 7, 2007.

  1. i'm trying to setup my blog and i have my cms coded together, but i can't seem to figure out how to list all of my id and contents (they are the blog entries) in reverse order. i have it setup so it shows the very first entry, then the next one all in order. but i would like to set it so that it shows the very latest id first on the list and moving the rest of the ids down 1. i have the ids set to auto-increment. any help here?
     
  2. Zac

    Zac New Member

    Joined:
    Nov 24, 2006
    Messages:
    151
    Likes Received:
    0
    Are you doing the SQL queries or whatever? If so it's prolly as simple as adding a 'order by' clause.

    select * from blogstuff order by id desc;

    desc = descending (ascending is the default)
     
  3. yeah its calling queries to the table inside the database. i'll give that a try thanks.
     
  4. jdw

    jdw New Member

    Joined:
    Dec 31, 2005
    Messages:
    4,429
    Likes Received:
    0
    Location:
    ND
    yeah, just select your ids in descending order. OR, if it was me I might stick a date code into the database when the blog entry is entered and sort it off that (either way should get you the same results).
     
  5. Nakon

    Nakon Guest

    this
     
  6. worked like a charm, thanks :wavey:
     

Share This Page