Jump to content


Photo

How I can UPDATE DB Row ?


  • Please log in to reply
2 replies to this topic

#1 alfarok

alfarok
  • Members
  • Pip
  • Newbie
  • 5 posts

Posted 16 March 2006 - 09:10 PM

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

#2 wickning1

wickning1
  • Members
  • PipPipPip
  • Advanced Member
  • 405 posts

Posted 16 March 2006 - 09:24 PM

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"

#3 alfarok

alfarok
  • Members
  • Pip
  • Newbie
  • 5 posts

Posted 17 March 2006 - 04:50 AM

Thanks

Yes that right,

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


thanks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users