stevesimo Posted July 31, 2007 Share Posted July 31, 2007 Hi, I want to return the last 3 records added to my table called towns. sql = "select * from towns limit 3" This only returns the first three rows, I want the last 3. My primary key field is townID Thanks Steve Link to comment https://forums.phpfreaks.com/topic/62632-return-last-3-records/ Share on other sites More sharing options...
hostfreak Posted July 31, 2007 Share Posted July 31, 2007 sql = "SELECT * FROM towns ORDER BY townID DESC LIMIT 3"; Link to comment https://forums.phpfreaks.com/topic/62632-return-last-3-records/#findComment-311741 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.