제

db에 html저장하기

· 2013-08-07 (수) 15:11:49 · 3375 · 1
$sql = "select wr_content from g4_write_test where wr_id=$wrid";
$result = sql_query($sql);
$row=mysql_fetch_array($result);
$a=$row[wr_content];
$b="<img src='ad.jpg' />";
$d = str_replace($text,$b,$a);
$sql = "update g4_write_test set wr_content=$d, wr_9='$wr9' where wr_id='$wrid'";
sql_query($sql);
g4_write_test 게시판에 특정 조건에 맞는 글의 content값(html)을 가저와서 변경한후에 다시 업데이트하는 건데요 위 구문을 실행시키면

update g4_write_test set wr_content=
html이 출력되고(html소스말고 진짜 div나 table img가 뜸)
, wr_9='7' where wr_id='19'

1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=
이런오류가뜨네요 어떻게 해야할까요 참고로 이파일은 view.skin.php에서 submit한 php페이지입니다
|

댓글 1개

$sql = "update g4_write_test set wr_content='$d', wr_9='$wr9' where wr_id='$wrid'";

wr_content=$d 를 wr_content='$d' 로 바꿔주세요
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
13-08-07 조회 1,657
13-08-07 조회 974
13-08-07 조회 3,376
13-08-07 조회 1,086
13-08-07 조회 1,086
13-08-07 조회 1,024
13-08-07 조회 1,745
13-08-07 조회 1,122
13-08-07 조회 1,631
13-08-07 조회 1,675
13-08-07 조회 1,723
13-08-07 조회 1,260
13-08-07 조회 1,630
13-08-07 조회 1,725
13-08-07 조회 1,539
13-08-06 조회 1,873
13-08-06 조회 1,681
13-08-06 조회 1,089
13-08-06 조회 980
13-08-06 조회 1,863