Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you mass replace characters with mySql?

Status
Not open for further replies.

HowdeeDoodee

Technical User
Mar 14, 2005
61
US
I want to mass replace three htlm character sets in one field in all records in my db. The field name is Subtopic and the db name is ViewTest. I want to replace <br><br><br> with <br><br> in all records. Is there a way to to this?
 
OK, folks here is your answer or my answer or however you want to put it.

Syntax:
update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');

Sytax applied to my particular table and so forth.

SQL-query: 
UPDATE `ViewTest` SET `Subtopic` = REPLACE ( `Subtopic` ,
'<br><br><br>',
'<br><br>')
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top