homepage Welcome to WebmasterWorld Guest from 54.227.41.242
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
MySQL - my first query
ImperialCommand




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

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?

 

topr8




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

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

you could do something like this:

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

ImperialCommand




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved