alfarok Posted March 16, 2006 Share Posted March 16, 2006 Hi all ,How I can UPDATE a row in my DB (MySQL) but Updating starts from End row to first row .. Example :If I have 3 rows in my DB and I want to update the last row without any condition .. Quote Link to comment https://forums.phpfreaks.com/topic/5105-how-i-can-update-db-row/ Share on other sites More sharing options...
wickning1 Posted March 16, 2006 Share Posted March 16, 2006 Add an auto_increment column called `id` (or whatever you want), then you can do: "UPDATE table SET column='value' ORDER BY id DESC LIMIT 1" Quote Link to comment https://forums.phpfreaks.com/topic/5105-how-i-can-update-db-row/#findComment-18121 Share on other sites More sharing options...
alfarok Posted March 17, 2006 Author Share Posted March 17, 2006 ThanksYes that right,I forgot Order by and I wrote DESC only so, it didn't workthanks Quote Link to comment https://forums.phpfreaks.com/topic/5105-how-i-can-update-db-row/#findComment-18248 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.