kamal213 Posted July 21, 2011 Share Posted July 21, 2011 Hi guys, Is it possible to select only the lastest added item/entry added to your database. If so could you tell me how. Thanks alot Quote Link to comment https://forums.phpfreaks.com/topic/242536-select-only-the-latest-item-from-mysql-database/ Share on other sites More sharing options...
Porl123 Posted July 21, 2011 Share Posted July 21, 2011 $sql = mysql_query("SELECT * FROM `table` ORDER BY `id` DESC LIMIT 1"); Btw, wrong section. ;o Quote Link to comment https://forums.phpfreaks.com/topic/242536-select-only-the-latest-item-from-mysql-database/#findComment-1245585 Share on other sites More sharing options...
harristweed Posted July 21, 2011 Share Posted July 21, 2011 http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html Quote Link to comment https://forums.phpfreaks.com/topic/242536-select-only-the-latest-item-from-mysql-database/#findComment-1245590 Share on other sites More sharing options...
kamal213 Posted July 21, 2011 Author Share Posted July 21, 2011 Lol! My Bad its coz I come here for help all the time thats y. Thanks for your help guys really appreciate! Quote Link to comment https://forums.phpfreaks.com/topic/242536-select-only-the-latest-item-from-mysql-database/#findComment-1245654 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.