HELPED-Find and Replace in PHPmyAdmin - Changing _ Underscores to - dashes

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
brainpoo
Forum Members
Forum Members
Posts: 37
Joined: Wed Jul 05, 2006 1:21 am

HELPED-Find and Replace in PHPmyAdmin - Changing _ Underscores to - dashes

Post by brainpoo »

Hello!

Okay, So i built a big site on the old CMSMS when it used to do underscores instead of dashes for Page Alias.  I much prefer the dashes and was very happy when the default was changed.

Anyway, I want to change all of the underscores to dashes in int he page alias field.

Here's the query I wanted to use in PHPmyAdmin

Code: Select all

UPDATE `cms_content` SET content_alias=replace(content_alias,’_’,'-’);
However, unfortunately, it doesn't work.  I'm not a smart SQL person and so I can't figure out what's wrong.  Any help appreciated.  Maybe it's just my version of MySQL.

Any other ideas on changing JUSt the Underscores in the content_alias field?

Thank you in advance,
    Shawn
Last edited by brainpoo on Tue Apr 24, 2007 12:16 am, edited 1 time in total.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm
Location: Comox Valley, BC

Re: Find and Replace in PHPmyAdmin - Changing _ Underscores to - dashes (Query H

Post by Nullig »

The syntax I found is:

UPDATE tablename SET tablefield = replace(tablefield,"findstring","replacestring");

I wonder if you need to enclose the findstring and replacestring in double quotes?

Nullig
brainpoo
Forum Members
Forum Members
Posts: 37
Joined: Wed Jul 05, 2006 1:21 am

Re: Find and Replace in PHPmyAdmin - Changing _ Underscores to - dashes (Query H

Post by brainpoo »

WOW, you ROCK!

It WAS just the " instead of ' for the strings.

Heh, i never thought it would have been something so simple.

Thank you Thank you!
Post Reply

Return to “CMSMS Core”