SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2001
    Location
    home
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP/MySQL Query - Last Row

    I'm working on a php/mysql tool and I'm trying to figure out how to correctly query the database for the last record in a table. Does anyone know? I'm poured through books, but they describe how to do everything but query for the last row in a table and return that specific data.

  2. #2
    pie??? PIE!!!! rsdl's Avatar
    Join Date
    May 2001
    Location
    Vancouver, BC Canada
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'd recommend that you have a field that is set to auto-increment. That way, all you have to do is do an ORDER BY id DESC and you're done.

    i hope this helps

    -rsdl


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
  •