waynew Posted May 21, 2008 Share Posted May 21, 2008 I have a table called MESSAGES. It holds all the posts to a particular board. The primary ID of each post starts at zero and increments automatically. I want to show only the last 20 posts. How should I go about doing that? As in what SQL? Also, I want to delete all of those who fall outside this last-20 paremeter. Any help on his subject would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/106649-easy-question/ Share on other sites More sharing options...
revraz Posted May 21, 2008 Share Posted May 21, 2008 ORDER BY DESC, LIMIT 20 would display the last 20. Quote Link to comment https://forums.phpfreaks.com/topic/106649-easy-question/#findComment-546644 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.