Child Trust Funds - Hummer Dealer - Web Games - Mobile Phone - Loans

PDA

View Full Version : Mysql replace question


sparksflying
Apr 29th 2007, 10:21 am
Hi ,

I have this one stumping me but probably a simple one...

I have a field in a WordPress DB thats in the following format ;

this is an example

I need to change all of them to

this-is-an-example

I thought i could use :

UPDATE `wp_posts` SET `post_name` = replace(`post_name`, '''', '-');

But no Joy..

Any ideas??

sparksflying
Apr 29th 2007, 1:05 pm
Anyone out there? ;)

SoKickIt
Apr 29th 2007, 2:05 pm
You were close :)

UPDATE `wp_posts` SET `post_name` = replace(`post_name`, ' ', '-');

sparksflying
Apr 30th 2007, 5:58 am
Excellent , thanks!
I couldnt be bold and ask if I could use the same to remove commas and questions marks in the same ? suppose i could..

Rep on its way :0)

sparksflying
Apr 30th 2007, 6:00 am
Sorry it wont let me leave you an itrader, sorry !

SoKickIt
Apr 30th 2007, 6:49 am
Sorry it wont let me leave you an itrader, sorry !

No problem.. you can leave an iTrader only in the "Buy, Sell or Trade" section.