테스트 사이트 - 개발 중인 베타 버전입니다

쿼리 질문할께요 채택완료

웹개발장인되자 7년 전 조회 2,694

p_configform.php

</p>

<p><?php

$sub_menu = '600300';

include_once('./_common.php');

include_once(G5_EDITOR_LIB);</p>

<p>auth_check($auth[$sub_menu], "r");</p>

<p>//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);

}</p>

<p>$sql = " SELECT * FROM {$g5['g5_shop_config_table']} ";

$row = sql_fetch($sql);</p>

<p>$g5['title'] = '환경설정';

include_once(G5_ADMIN_PATH.'/admin.head.php');

?></p>

<p><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></p>

<p>    <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></p>

<p><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></p>

<p></form></p>

<p><script>

function fconfig_check(f)

{

    <?php echo get_editor_js('s_order_info'); ?></p>

<p>    return true;

}

</script>

<?php

include_once(G5_ADMIN_PATH.'/admin.tail.php');

?></p>

<p>

 

p_configformupdate.php

</p>

<p><?php

$sub_menu = '600300';

include_once('./_common.php');</p>

<p>check_demo();</p>

<p>auth_check($auth[$sub_menu], "w");</p>

<p>check_admin_token();</p>

<p>//

// 영카트 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);</p>

<p>

goto_url("./p_configform.php");

?></p>

<p>

g5_shop_config 테이블이 없으면

g5_shop_config 테이블을 생성하고

확인을 누르면 수정 저장이 가능하게 하려고 하는데

테이블 생성까지는되는데 수정 저장이 안됩니다.

해결해 주실분 계신가요?

 

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

답변 1개

채택된 답변
+20 포인트
S
7년 전

g5_shop_config 테이블을 생성하시고 내용이 없는 상태에서 update 구문을 실행하면 아무런 변화가 없습니다.

 

g5_shop_config 테이블 생성후 기본사항들은 insert 로 넣으신 후에 update 구문을 실행하셔야 됩니다.

 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

웹개발장인되자
7년 전
빠른 답변 감사합니다!
로토루아
7년 전
임시로

$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 = " insert into {$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']}' ";

로 수정하신 후 실행하시면 등록이 될꺼에요..
등록 된 후 다시 update 로 돌려놓이시면 될꺼에요..

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

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

로그인