How to display the last submitted result from my sql

Discussion in 'PHP' started by eritrea1, Jun 13, 2012.

  1. #1
    Hi, i have a site in which logged in users can submit articles and on the left panel of the site, i want to display all the recent data by title, from sql.

    but, the problem is that, i do not know how to show the latest result, i can display by random RAND(), or limit with DESC LIMIT 5/6/.. but not by last submitted.


    Any help would be appreciated.
     
    eritrea1, Jun 13, 2012 IP
  2. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #2
    The last submitted (or newest entry) would be the row with the most recent time stamp. So if you have a timestamp column with the name of "created" it would be: ORDER BY created DESC LIMIT 0, 1;
     
    NetStar, Jun 13, 2012 IP