Results 1 to 3 of 3
Thread: Finding newest item.
May 23, 2001, 21:09 #1
I have a page that dynamically delivers various data, but when there is no query string, I want it to post the 10 most recent additions. I have a timestamp that is added when data is submitted into the database. I have it in 8 size. [timestamp(8)] What I don't know how to do is compare the timestamps, and find the 10 most recent.
SELECT * FROM tips WHERE date=???????
somewhere I need to find the 10 most recent. I also have an auto-incremented column, so the newest tips would also have the highest values in the tip_id column, so how do I select the 10 most recent ones?
May 23, 2001, 21:12 #2
- Join Date
- Feb 2001
- New Zealand
- 0 Post(s)
- 0 Thread(s)
SELECT * FROM tips ORDER BY date DESC LIMIT 10
Correct me if I am wrong, but that should select everything from the tips table ordered by the date descending with a limit of 10.
May 23, 2001, 21:17 #3