sql 문의드립니다.
본문
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
sql_query("update ".$write_table." set wr_20 = '".$wr_20."' where wr_id= '".$wr_id."' " );
".$wr_20." 앞 뒤로 ' <--요게 있으면 될겁니다.