Hi I am trying to find and replace a string inside one column inside one table. Currently I am using: $sqlX = "UPDATE table SET column = replace(column, 'find_this_string', 'replace_with_this_string')"; Code (markup): The problem is, I want to find this string anywhere in the content of the field. So for example: Replace here: Any content here find_this_string and any cotnent here. Code (markup): To make it look like here: Any content here replace_with_this_string and any cotnent here. Code (markup): My first guess would be something like: $sqlX = "UPDATE table SET column = replace(column, '*find_this_string*', 'replace_with_this_string')"; Code (markup): But this doesn’t work. Can someone please help me out? Thank you very much in advance!
You could attach a WHERE clause where text LIKE $sqlX = "UPDATE table SET column = replace(column, 'find_this_string', 'replace_with_this_string') WHERE column LIKE '%find_this_string%'"; Code (markup):