Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

MySQL - my first query



2:56 am on Nov 12, 2011 (gmt 0)

5+ Year Member

Here's what happened - I ftp copied my WordPress files from a sub-directory (named "content") to the root directory.
The mysql database still has over 1000 entries using the \content\ as part of its directory structure.

I need to remove \content\
and replace it with
in the database.

Is there a solution to this by writing a query?
How would it be done?


6:20 am on Nov 12, 2011 (gmt 0)

WebmasterWorld Senior Member topr8 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

mySQL has a REPLACE function... [dev.mysql.com...]

you could do something like this:

UPDATE table SET fieldname = REPLACE(fieldname,'\content\','\');


1:47 pm on Nov 12, 2011 (gmt 0)

5+ Year Member

thanks topr8 - I think your way is the smart way to do it but couldn't find the command for it.

Featured Threads

Hot Threads This Week

Hot Threads This Month