ryan1234 Posted December 8, 2012 Share Posted December 8, 2012 I've got a SQL database which includes an auto increment id column. On my web page I want it to display the last 2 entered rows entered into the database. How would I go about doing this? Thanks. Link to comment https://forums.phpfreaks.com/topic/271759-show-last-2-rows/ Share on other sites More sharing options...
MDCode Posted December 8, 2012 Share Posted December 8, 2012 $sql = "SELECT * FROM table ORDER BY `id` DESC LIMIT 2"; Link to comment https://forums.phpfreaks.com/topic/271759-show-last-2-rows/#findComment-1398271 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.