2011-04-21 5 views
0

SQL 데이터베이스에서 이미지 경로를 업데이트하려고합니다. 나는 다음과 같은 시도했지만 작동하지 않았다 :이미지 경로를 검색하고 바꿔야합니다.

UPDATE `wp_posts` 
SET `post_content` = replace(`post_content`,'%src="http://www.theworldeffect.com/.a/%"%','src="http://www.domainname.com/timages/%.jpg"') 

답변

0

에서이

update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find this string’, ‘replace found string with this string’); 

을보십시오. 당신은 단지 접두사를 대체 할이 예를

replace(`post_content`, 'src="http://www.theworldeffect.com/.a/', 
         'src="http://www.domainname.com/timages/') 

이 들어 다른 정적 문자열로 주어진 문자열을 대체 사용할 수 있습니다,하지만 당신을 위해 충분히있을 수 있습니다.

관련 문제