I need to find and replace multiple lines from tabular "phrases" using the "dict" table
I have code like:
update phrases, dict set phrases.name = replace(phrases.name, dict.source, dict.translate) where phrases.name <> replace(phrases.name, dict.source, dict.translate)
An example pharses table:
id | name | .. | .. 1 | macbook wht comput | .. 2 | lenova blck god nb | ..
Example dict table:
id | source | translate 1 | wht | white 2 | god | good 3 | lenova | lenovo 4 | blck | black 5 | comput | computer 6 | nb | notebook
I need to get lights like this:
id | name | .. | .. 1 | macbook white computer | .. 2 | lenova black good notebook | ..
It will replace only one line in a row, but I have about 3-10 lines to replace.
How can this code be changed to replace all the lines in the lines?
sql mysql mysqli mysql-error-1064
user2421781
source share