Jump to content

Archived

This topic is now archived and is closed to further replies.

alfarok

How I can UPDATE DB Row ?

Recommended Posts

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 ..

Share this post


Link to post
Share on other sites
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"

Share this post


Link to post
Share on other sites
Thanks

Yes that right,

I forgot Order by and I wrote DESC only so, it didn't work


thanks

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.