Change One Cell's Data in mysql

kasrsf picture kasrsf · Jun 11, 2010 · Viewed 364.9k times · Source

How can I change the data in only one cell of a mysql table. I have problem with UPDATE because it makes all the parameters in a column change but I want only one changed. How?

Answer

Brian Hooper picture Brian Hooper · Jun 11, 2010

You probably need to specify which rows you want to update...

UPDATE 
    mytable
SET 
    column1 = value1,
    column2 = value2
WHERE 
    key_value = some_value;