SQL 데이터베이스에서 이미지 경로를 업데이트하려고합니다. 나는 다음과 같은 시도했지만 작동하지 않았다 :이미지 경로를 검색하고 바꿔야합니다.
UPDATE `wp_posts`
SET `post_content` = replace(`post_content`,'%src="http://www.theworldeffect.com/.a/%"%','src="http://www.domainname.com/timages/%.jpg"')
SQL 데이터베이스에서 이미지 경로를 업데이트하려고합니다. 나는 다음과 같은 시도했지만 작동하지 않았다 :이미지 경로를 검색하고 바꿔야합니다.
UPDATE `wp_posts`
SET `post_content` = replace(`post_content`,'%src="http://www.theworldeffect.com/.a/%"%','src="http://www.domainname.com/timages/%.jpg"')
에서이
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/')
이 들어 다른 정적 문자열로 주어진 문자열을 대체 사용할 수 있습니다,하지만 당신을 위해 충분히있을 수 있습니다.
당신을 위해 정규식 일치하지 않을 것이다) (대체
http://www.mydigitallife.info/how-to-find-and-replace-text-in-mysql-database-using-sql/
이것이 도움이 될지 확실하지 않은 경우 와일드 카드로 %를 사용할 수 있다고 생각하지 마십시오. 당신은 그것없이 할 수 있습니까? – gmadd