Recommended tutorial: SQL tutorial
Usage one: UPDATE table name SET column name = new value WHERE column name = a certain value
Modify the age of student Li Si
UPDATE student SET age = 18 WHERE `name` = '李思'
##View the modified Result
Usage 2:Update several columns in a row
UPDATE table name SET column 1 name = new value, column 2 name = new value WHERE column name = a certain valueModify Li Si's name and age
UPDATE student SET `name` = '李思2', age = 100WHERE `name` = '李思'
The results showThe name of Li Si was changed to Li Si 2 and the age is 100
##
The above is the detailed content of sql command to update records. For more information, please follow other related articles on the PHP Chinese website!