In mysql, you can use the replace function to replace letters, and its syntax is such as "mysql> UPDATE `dede` SET body = REPLACE (body, '', '' );".
Recommended: "mysql video tutorial"
mysql replacement string
The replace function in mysql directly replaces a specific string in a field in the mysql database. You no longer need to write a function to replace it. It is very convenient to use. mysql replacement function replace()
UPDATE table_name SET field_name = REPLACE ( field_name , 'from_str', 'to_str' );
Description:
table_name - the name of the table
field_name - the field name
from_str - needs to be replaced String
to_str ——The string replaced by
For example:
mysql> UPDATE `dede` SET body = REPLACE ( body, '', '' );
This function is multi-byte safe, which means you don’t have to consider whether it is Chinese characters or English characters.
The above is the detailed content of How to replace letters in mysql. For more information, please follow other related articles on the PHP Chinese website!