I'm having a table like this called v3_product_description
.
+------------+-------------+-------------+--------------------------------------------------------------------+----------+--------------------------------------------------------------------+--------------------+------------+--+
| product_id | language_id | name | description | tag | meta_description | meta_keywords | meta_title | |
+------------+-------------+-------------+--------------------------------------------------------------------+----------+--------------------------------------------------------------------+--------------------+------------+--+
| 1 | 2 | Test | descrition about product. Altijd op voorraad. further description. | tag | descrition about product. Altijd op voorraad. further description. | keywords | title | |
| 2 | 1 | test | Beschrijving over het product | tagsss | metabeschrijving Altijd op voorraad | keywords,and so on | title | |
| 3 | 2 | Tessdslfkjq | product description | moretags | metadescription Altijd op voorraad | keywords,bullshit | titlestuff | |
+------------+-------------+-------------+--------------------------------------------------------------------+----------+--------------------------------------------------------------------+--------------------+------------+--+
As you guys can see the phrase Altijd op voorraad
is very common in my table (I have over 8000 rows in the real database).
Altijd op voorraad
translated to German is Immer auf Lager
and the language_id
for German is 2
.
I'm trying to search and replace that phrase in my tables so I came up with this query:
SELECT product_id, language_id, name, description, tag, meta_title, meta_description, meta_keyword,
REPLACE(meta_description,'Altijd op voorraad','Immer auf Lager')
FROM v3_product_description
WHERE language_id = 2
This query should change every Altijd op voorraad
in column meta_description
to Immer auf Lager
. But once executed it doesn't seem to do so when I view the items in my web-shop.
What am I doing wrong? And how to apply the same search/replace at column description
? Should I do this with a 2nd query or can those 2 be combined?