Zen Cart Logo
Forums / General Questions / SQL command replace a word in the products description with Variable word?

SQL command replace a word in the products description with Variable word?

Views: 1,334

Results 1 to 4 of 4
21 Apr 2012, 10:50 AM
#1
liyucmh avatar

liyucmh

New Zenner

Join Date:
Apr 2012
Posts:
14
Plugin Contributions:
0

SQL command replace a word in the products description with Variable word?

I want to use SQL command to find and replace a word in the products description, and I want to replace with Variable word, such as replace some word with the exactly product's name, I use this command:

update products_description set products_description=replace(products_description,'xxx','$meta_products_name');

but it did not work at all, it just replace all xxx with $meta_products_name, can not get the product's name and replace xxx, anyone can help me?

26 Apr 2012, 3:23 AM
#2
liyucmh avatar

liyucmh

New Zenner

Join Date:
Apr 2012
Posts:
14
Plugin Contributions:
0

Re: SQL command replace a word in the products description with Variable word?

Is there some one help me? thanks a lot

27 Apr 2012, 1:30 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: SQL command replace a word in the products description with Variable word?

It is doing exactly what you told it to do.

I'm not clear what exactly you were hoping it would do differently, nor why you are even asking this question in the first place. MUCH MORE information is needed. What business problem is this supposed to solve?

11 May 2012, 11:35 AM
#4
liyucmh avatar

liyucmh

New Zenner

Join Date:
Apr 2012
Posts:
14
Plugin Contributions:
0

Re: SQL command replace a word in the products description with Variable word?

Sorry, I did not explain very well, and make you confuse, I just want to use sql command to replace some phase of the product's description with the product's name, for example, I want replace each "it" in the product's description with its "product's name", what should I do?