채택완료

sql 문의드립니다.

2018-11-25 (일) 21:21:53 3,655

view 스킨에서 내용 수정을 하기위해 아래와 같이 데이터를 넣는데 숫자만 있을땐 되는데 문자열은 적용이 안되는데 수정이 필요한지요? 도움 부탁드립니다.

view.skin.php

<form name="update_view_write" action="<?php echo $board_skin_url; ?>/update.php" method="post" style="padding:0; margin:0;">
                <input type="hidden" name="bo_table" value="<?php echo $bo_table; ?>">
                <input type="hidden" name="page" value="<?php echo $page; ?>">
                <input type="hidden" name="wr_id" value="<?php echo $wr_id; ?>">
                <input type="hidden" name="location" value="next">

<input class='frm_input' type="text" value="<?=$write[wr_20]?>" name="wr_20"  id="wr_20" size="9"  itemname="테스트"><input type="submit" value=" 변경 " style="width:50px; height:34px;"></form>

update.php

<?php
include_once "../../../common.php";

 $write_table = $g5['write_prefix'].$_POST['bo_table'];
 sql_query("update ".$write_table." set wr_20 = ".$wr_20." where wr_id= '".$wr_id."' " );
 //exit;
header("location: $_SERVER[HTTP_REFERER]");
?>

|

답변 1개 / 댓글 1개

채택된 답변
+20 포인트

sql_query("update ".$write_table." set wr_20 = '".$wr_20."' where wr_id= '".$wr_id."' " );

".$wr_20." 앞 뒤로 ' <--요게 있으면 될겁니다.

답변에 대한 댓글 1개

2018-11-25 (일) 21:52:23
잘됩니다. 감사합니다~~~^^

답변을 작성하려면 로그인이 필요합니다.