chelnov63 Posted May 27, 2007 Share Posted May 27, 2007 Hi, using LIMIT I know how to easily retrieve the first 10 records from the database. But is there an easy way to retrieve the LAST 10 records from the database? Cheers e.g $sql = "SELECT * FROM employees"; How would i retrieve the last 10 records.. cheers in advance Quote Link to comment https://forums.phpfreaks.com/topic/53176-solved-retrieve-last-ten-records-from-the-database/ Share on other sites More sharing options...
AndyB Posted May 27, 2007 Share Posted May 27, 2007 ... ORDER by id DESC LIMIT 10 Quote Link to comment https://forums.phpfreaks.com/topic/53176-solved-retrieve-last-ten-records-from-the-database/#findComment-262698 Share on other sites More sharing options...
chelnov63 Posted May 27, 2007 Author Share Posted May 27, 2007 DOH!!!! thanks for that!!! Quote Link to comment https://forums.phpfreaks.com/topic/53176-solved-retrieve-last-ten-records-from-the-database/#findComment-262700 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.