update value in mysql code example

Example 1: sql update query

--update query example
 UPDATE table_name
 SET column1 = value1, column2 = value2, ...
 WHERE condition;

Example 2: update set mysql

UPDATE tableName SET anAttribute = 'Something' WHERE anOtherAttribute = 'SomethingElse'

//All 'SomethingElse' values will become 'Something'

Example 3: update all rows mysql

UPDATE tableName SET columnName = yourValue;
#to update multiple columns:
UPDATE tableName SET column1 = value1, column2 = value2; #and so on

Tags:

Php Example