To update data currently in your database, you use the UPDATE command. You specify all the fields you want to change, and the values you want to change them to like this:
UPDATE usertable SET FirstName = 'Joe', Age = 30;
That statement will change all records in usertable so that they have the FirstName "Joe" and Age "30". We can filter the rows to be updated by using a WHERE clause, just like in SELECT. So, to change all people with FirstName "Joe" to FirstName "Peter", we would use this statement:
UPDATE usertable SET FirstName = 'Peter' WHERE FirstName = 'Joe';
It's quite easy, isn't it? UPDATE can also use the LIMIT clause, to allow you to only update the first n matching rows, but this is rarely used.
Copyright 2012 Future Publishing Limited (company
registered number 2008885), a company registered
in England and Wales whose registered office is at