쿼리 질문할께요
본문
p_configform.php
<?php
$sub_menu = '600300';
include_once('./_common.php');
include_once(G5_EDITOR_LIB);
auth_check($auth[$sub_menu], "r");
//DB 테이블 생성
if(!sql_query(" DESCRIBE {$g5['g5_shop_config_table']} ", false)) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['g5_shop_config_table']}` (
`s_device_group` varchar(255) NOT NULL DEFAULT '',
`s_installment` varchar(255) NOT NULL DEFAULT '',
`s_agreement` varchar(255) NOT NULL DEFAULT '',
`s_choices` int(11) NOT NULL DEFAULT '',
`s_add_support` int(11) NOT NULL DEFAULT '',
`s_installment_fee` int(11) NOT NULL DEFAULT '',
`s_order_info` text NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
}
$sql = " SELECT * FROM {$g5['g5_shop_config_table']} ";
$row = sql_fetch($sql);
$g5['title'] = '환경설정';
include_once(G5_ADMIN_PATH.'/admin.head.php');
?>
<form name="fconfig" action="./p_configformupdate.php" onsubmit="return fconfig_check(this)" method="post" enctype="MULTIPART/FORM-DATA">
<input type="hidden" name="token" value="">
<section id="anc_scf_info">
<h2 class="h2_frm">기본설정</h2>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>기본설정 입력</caption>
<colgroup>
<col class="grid_4">
<col>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="s_device_group">디바이스 그룹</label></th>
<td>
<input type="text" name="s_device_group" value="<?php echo $row['s_device_group']; ?>" id="s_device_group" class="frm_input" size="30">
</td>
</tr>
<tr>
<th scope="row"><label for="s_installment">할부 개월</label></th>
<td>
<input type="text" name="s_installment" value="<?php echo $row['s_installment']; ?>" id="s_installment" class="frm_input" size="30">
</td>
</tr>
<tr>
<th scope="row"><label for="s_agreement">약정 개월</label></th>
<td>
<input type="text" name="s_agreement" value="<?php echo $row['s_agreement']; ?>" id="s_agreement" class="frm_input" size="30">
</td>
</tr>
<tr>
<th scope="row"><label for="s_choices">선택 약정 퍼센트</label></th>
<td>
<input type="text" name="s_choices" value="<?php echo $row['s_choices']; ?>" id="s_choices" class="frm_input" size="30">
</td>
</tr>
<tr>
<th scope="row"><label for="s_add_support">추가지원금</label></th>
<td>
<input type="text" name="s_add_support" value="<?php echo $row['s_add_support']; ?>" id="s_add_support" class="frm_input" size="30">
</td>
</tr>
<tr>
<th scope="row"><label for="s_installment_fee">할부수수료</label></th>
<td>
<input type="text" name="s_installment_fee" value="<?php echo $row['s_installment_fee']; ?>" id="s_installment_fee" class="frm_input" size="30">
</td>
</tr>
<tr>
<th scope="row">안내사항</th>
<td><?php echo editor_html('s_order_info', get_text($row['s_order_info'], 0)); ?></td>
</tr>
</tbody>
</table>
</div>
</section>
<div class="btn_fixed_top">
<a href=" <?php echo G5_SHOP_URL; ?>" class="btn btn_02">쇼핑몰</a>
<input type="submit" value="확인" class="btn_submit btn" accesskey="s">
</div>
</form>
<script>
function fconfig_check(f)
{
<?php echo get_editor_js('s_order_info'); ?>
return true;
}
</script>
<?php
include_once(G5_ADMIN_PATH.'/admin.tail.php');
?>
p_configformupdate.php
<?php
$sub_menu = '600300';
include_once('./_common.php');
check_demo();
auth_check($auth[$sub_menu], "w");
check_admin_token();
//
// 영카트 default
//
$sql = " update {$g5['g5_shop_config_table']}
set s_device_group = '{$_POST['s_device_group']}',
s_installment = '{$_POST['s_installment']}',
s_agreement = '{$_POST['s_agreement']}',
s_choices = '{$_POST['s_choices']}',
s_add_support = '{$_POST['s_add_support']}',
s_installment_fee = '{$_POST['s_installment_fee']}',
s_order_info = '{$_POST['s_order_info']}' ";
sql_query($sql);
goto_url("./p_configform.php");
?>
g5_shop_config 테이블이 없으면
g5_shop_config 테이블을 생성하고
확인을 누르면 수정 저장이 가능하게 하려고 하는데
테이블 생성까지는되는데 수정 저장이 안됩니다.
해결해 주실분 계신가요?
!-->!-->
답변 1
g5_shop_config 테이블을 생성하시고 내용이 없는 상태에서 update 구문을 실행하면 아무런 변화가 없습니다.
g5_shop_config 테이블 생성후 기본사항들은 insert 로 넣으신 후에 update 구문을 실행하셔야 됩니다.
답변을 작성하시기 전에 로그인 해주세요.