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 .. 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" 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 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
Archived
This topic is now archived and is closed to further replies.