Question

I have translated the table for vbullitin.

An example of content of this record:

                                                            | product   | username | dateline | version |

+----------+------------+-------------+-----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+----------+----------+---------+ | 103321 | 2 | usermessage | emailbody | Dit is een bericht van $bbuserinfo[username] van $vboptions[bbtitle] ( $vboptions[bburl]/$vboptions[forumhome].php ). De eigenaren van $vboptions[bbtitle] zijn niet verantwoordelijk voor de inhoud van deze e-mail.

The field text contains $bbuserinfo[username] I want to change it to $userinfo[username] and I want to leave the rest intact .

Is there any way I can update all records with query replacing $bbuserinfo with $userinfo ?

Was it helpful?

Solution

Use the REPLACE() function.

UPDATE YourTable
SET text = REPLACE(text, '$bbuserinfo', '$userinfo');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top