Solved

wordpress - sql query - comments table - replace mutiple words

Posted on 2014-01-29
1
118 Views
Last Modified: 2014-09-19
On wordpress 3.8

on comments table

What sql query will replace
word1 with word2  
word3 with word4
.
.
word99 with word100



P.S.

I have 10 questions, highest point level - open about sql queries

Soo, Lots of points for an sql guy
0
Comment
Question by:Matt_Walker01
1 Comment
 
LVL 26

Accepted Solution

by:
Zberteoc earned 500 total points
ID: 39820894
You can use nested REPLACE functions:
UPDATE your_table SET 
	your_field = REPLACE(...REPLACE(your_field, 'word1', 'word2'), 'word3', 'word4'),...'word99','word100')
WHERE <condition_here>

Open in new window

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
Creating and Managing Databases with phpMyAdmin in cPanel.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now