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. Quote 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"; Quote Link to comment https://forums.phpfreaks.com/topic/271759-show-last-2-rows/#findComment-1398271 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.