I have some characters that I want replace them with some other characters.
-=>*/=>.<=>{>=>}
Also here is an example of a record in the table: (database)
+-------------------+
| - it <is> a test/ |
+-------------------+
And I want this output:
+-------------------+
| * it {is} a test. |
+-------------------+
Well, I can do that using 4 separated update queries: (through execute them one after the other)
UPDATE table SET `col` = REPLACE(`col`, '-', '*' );
UPDATE table SET `col` = REPLACE(`col`, '/', '.' );
UPDATE table SET `col` = REPLACE(`col`, '<', '{' );
UPDATE table SET `col` = REPLACE(`col`, '>', '}' );
Now I want to know, is there any shorter solution? (because in reality, there is more than 12 cases for replacing). For example, is it possible to I write all those symbol in an array and then put that array in the update query just for one time?