phpmyadmin에서 특정문구 치환

phpmyadmin에서 특정문구 치환

QA

phpmyadmin에서 특정문구 치환

본문

update 테이블 wr_content=REPLACE(wr_content,'기존단어','바꿀단어')

 

이렇게 알고 있습니다.

<img src = <img src='https://taesarang.com

이 부분을 

<img src="https://thailove.net/taesarang

이렇게 바꾸기 위해

 

UPDATE g5_write_01_1 SET wr_content=REPLACE(wr_content,'<img src = <img src='https://taesarang.com','<src="https://thailove.net/taesarang') ;

이렇게 하고 실행했는데

바꿀 단어 안에 작은 따옴표가 있어서 그런가 아래와 같은 오류가 나오네요.

이럴 경우 어떻게 해야 할까요?

 

 


 

정적 분석 :

분석 중에 1개의 오류가 발생했습니다.

 

  1. 닫는 따옴표 " 가 팔요합니다. (near "" at position 140)

 

SQL 질의: 복사

update g5_write_free set wr_content=REPLACE(wr_content,'<img src = <img src='https://taesarang.com','<src="https://thailove.net/taesarang');

MySQL 메시지: 문서

#1064 - 'SQL 구문에 오류가 있습니다.' 에러 같읍니다. ('https://taesarang.com','<src="https://thailove.net/taesarang')' 명령어 라인 1)
 

 

이 질문에 댓글 쓰기 :

답변 2

UPDATE g5_write_01_1 SET wr_content=REPLACE(wr_content,'<img src = <img src=\'https://taesarang.com','<img src="https://thailove.net/taesarang') ;

MySQL recognizes the following escape sequences.
\0     An ASCII NUL (0x00) character.
\'     A single quote (“'”) character.
\"     A double quote (“"”) character.
\b     A backspace character.
\n     A newline (linefeed) character.
\r     A carriage return character.
\t     A tab character.
\Z     ASCII 26 (Control-Z). See note following the table.
\\     A backslash (“\”) character.
\%     A “%” character. See note following the table.
\_     A “_” character. See note following the table.
답변을 작성하시기 전에 로그인 해주세요.
전체 123,536 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT