SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Pulling data from sql server backwords

    Hey , im realy new to php & sql so sorry if this is a realy dumb question lol , but is there a way to fetch info from the sql server from the last intry to the first, or will i have to just fetch the info then use php to minipulate it ?

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,021
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    use ORDER BY with the DESCENDING option
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Addict phpster's Avatar
    Join Date
    Feb 2005
    Location
    Toronto, Canada
    Posts
    374
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use the order by clause

    ...order by fieldname desc

    where desc is the key to start with the latest...default and therefore not explicitly stated is the ASC for first to last order
    phpster

    I wish my computer would do what I want it to.
    Not what I tell it to do...

  4. #4
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    alright i rmemeber using that befor to ... thanks for the speedy reply guys i appreciate it


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
  •