'How to replace a specific value in a MySQL row if the word is exist?
How can I replace a specific value in MySQL if it's exist?
I have a servers table in that table I have an opts row the row's value is:
+set net_port 28112 +set rcon_password asd +set fs_game mods/pml220 +set sv_punkbuster 1 +exec server.cfg +map_rotate
I don't want to update the whole row with update statemet just want to replace the +set fs_game mods/pml220 to +set fs_game mods/test
I tried with the REPLACE statement but to be honest I don't really understand what is going on, lol.
SELECT opts,
REPLACE( opts, '+set fs_game mods/pml220', '+set fs_game mods/test' ) as opts
FROM servers
WHERE srvid>2709;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
