If you want to update all entries in a MySQL or MariaDB database table for entries that meet a specific criterion, you can use a Structured Query Language (SQL) command like the one below:
SET column_name = "new_value"
WHERE colum_name = "old_value";
E.g., suppose I have a table named "Students" in a database I'm currently using with a column in the table named "LastName". Suppose, there are students named Smith whose last name has changed to Lamb and I want to change all instances where an entry in the table has "Smith" in the LastName field to "Lamb". I could use the following SQL command:
SET LastName = "Lamb"
WHERE LastName = "Smith";
If you want to change every entry in a table, simply leave off the
WHERE
clause.
If you want to change multiple fields/columns in a table at the same
time, you can separate them with commas in the SET
statement,
i.e., SET column1=value1,column2=value2,...
. E.g., suppose all of
the students with a last name of Smith are also undergoing an address change as
well as a change to their last name.
SET LastName = "Lamb", Address="1234 Cherry Lane"
WHERE LastName = "Smith";