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?

Started by liyucmh on 21 Apr 2012, 10:50 AM · Views: 1,342

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,511
Plugin Contributions:
176

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?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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?