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 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 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!!! 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
Archived
This topic is now archived and is closed to further replies.