bamfon Posted January 12, 2011 Share Posted January 12, 2011 How do I show the last row thats been added into a table or is there a better way of doing what i want to do Well so far here is the plan You enter the info in to the text box and click submit it then send you to a 2ed page that tells you its adding the info in then it send you to the 3ed page I want it to show the Row ID on the 3ed page from the data it just added in to the table Thank you for your kind reply Quote Link to comment https://forums.phpfreaks.com/topic/224247-how-do-i-show-the-last-row/ Share on other sites More sharing options...
Maq Posted January 12, 2011 Share Posted January 12, 2011 You most likely have some sort of auto-incremented id in which you can use with a basic query: SELECT * FROM table ORDER BY id DESC LIMIT 1 Quote Link to comment https://forums.phpfreaks.com/topic/224247-how-do-i-show-the-last-row/#findComment-1158636 Share on other sites More sharing options...
bamfon Posted January 13, 2011 Author Share Posted January 13, 2011 Thank you you are the boss. Quote Link to comment https://forums.phpfreaks.com/topic/224247-how-do-i-show-the-last-row/#findComment-1158665 Share on other sites More sharing options...
Pikachu2000 Posted January 13, 2011 Share Posted January 13, 2011 If you're trying to get the autoincremented index of the record that was just inserted, you can also use mysql_insert_id. Quote Link to comment https://forums.phpfreaks.com/topic/224247-how-do-i-show-the-last-row/#findComment-1158673 Share on other sites More sharing options...
Maq Posted January 13, 2011 Share Posted January 13, 2011 If you're trying to get the autoincremented index of the record that was just inserted, you can also use mysql_insert_id. Good point Pika. Depending on what you want to do this might be better. Quote Link to comment https://forums.phpfreaks.com/topic/224247-how-do-i-show-the-last-row/#findComment-1158937 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.