그누보드5 상품등록오류

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
그누보드5 상품등록오류

QA

그누보드5 상품등록오류

본문

select ca_id, ca_id2 from g5_shop_category order by ca_order, ca_id limit 1

1054 : Unknown column 'ca_id2' in 'field list'

error file : /adm/shop_admin/itemform.php

 

그누보드 5 상품등록 눌렀을때 발생한 오류입니다.

 

 

 

 

 

이거는 itemform.php 파일입니다.

<?php

$sub_menu = '400300';

include_once('./_common.php');

include_once(G5_EDITOR_LIB);

include_once(G5_LIB_PATH.'/iteminfo.lib.php');


auth_check($auth[$sub_menu], "w");


$html_title = "상품 ";


if ($w == "")

{

    $html_title .= "입력";


    // 옵션은 쿠키에 저장된 값을 보여줌. 다음 입력을 위한것임

    //$it[ca_id] = _COOKIE[ck_ca_id]);

    $it['ca_id'] = get_cookie("ck_ca_id");

    $it['ca_id2'] = get_cookie("ck_ca_id2");

    $it['ca_id3'] = get_cookie("ck_ca_id3");

    if (!$it['ca_id'])

    {

       $sql = " select ca_id, ca_id2 from {$g5['g5_shop_category_table']} order by ca_order, ca_id limit 1 ";

        $row = sql_fetch($sql);

        if (!$row['ca_id'])

            alert("등록된 분류가 없습니다. 우선 분류를 등록하여 주십시오.", './categorylist.php');

        $it['ca_id'] = $row['ca_id'];

  $it['ca_id2'] = $row['ca_id2'];

    }

   // $it[it_maker]  = stripslashes($_COOKIE[ck_maker]);

  //$it[it_origin] = stripslashes($_COOKIE[ck_origin]);

    $it['it_maker']  = stripslashes(get_cookie("ck_maker"));

    $it['it_origin'] = stripslashes(get_cookie("ck_origin"));

}

else if ($w == "u")

{

    $html_title .= "수정";


    if ($is_admin != 'super')

    {

        $sql = " select it_id from {$g5['g5_shop_item_table']} a, {$g5['g5_shop_category_table']} b

                  where a.it_id = '$it_id'

                    and a.ca_id = b.ca_id

                    and b.ca_mb_id = '{$member['mb_id']}' ";

        $row = sql_fetch($sql);

        if (!$row['it_id'])

            alert("\'{$member['mb_id']}\' 님께서 수정 할 권한이 없는 상품입니다.");

    }


    $sql = " select * from {$g5['g5_shop_item_table']} where it_id = '$it_id' ";

    $it = sql_fetch($sql);


    if(!$it)

        alert('상품정보가 존재하지 않습니다.');


    if (!$ca_id)

        $ca_id = $it['ca_id'];


    $sql = " select * from {$g5['g5_shop_category_table']} where ca_id = '$ca_id' ";

    $ca = sql_fetch($sql);

}

else

{

    alert();

}


$qstr  = $qstr.'&sca='.$sca.'&page='.$page;


$g5['title'] = $html_title;

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


// 분류리스트

$category_select = '';

$script = '';

$sql = " select * from {$g5['g5_shop_category_table']} ";

if ($is_admin != 'super')

    $sql .= " where ca_mb_id = '{$member['mb_id']}' ";

$sql .= " order by ca_order, ca_id ";

$result = sql_query($sql);

for ($i=0; $row=sql_fetch_array($result); $i++)

{

    $len = strlen($row['ca_id']) / 2 - 1;


    $nbsp = "";

    for ($i=0; $i<$len; $i++)

        $nbsp .= "   ";


    $category_select .= "<option value=\"{$row['ca_id']}\">$nbsp{$row['ca_name']}</option>\n";


    $script .= "ca_use['{$row['ca_id']}'] = {$row['ca_use']};\n";

    $script .= "ca_stock_qty['{$row['ca_id']}'] = {$row['ca_stock_qty']};\n";

    //$script .= "ca_explan_html['$row[ca_id]'] = $row[ca_explan_html];\n";

    $script .= "ca_sell_email['{$row['ca_id']}'] = '{$row['ca_sell_email']}';\n";

}



// 추가옵션 포인트 설정 필드 추가

if(!sql_query(" select it_supply_point from {$g5['g5_shop_item_table']} limit 1 ", false)) {

    sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`

                    ADD `it_supply_point` int(11) NOT NULL DEFAULT '0' AFTER `it_point_type` ", true);

}


$pg_anchor ='<ul class="anchor">

<li><a href="#anc_sitfrm_cate">상품분류</a></li>

<li><a href="#anc_sitfrm_skin">스킨설정</a></li>

<li><a href="#anc_sitfrm_ini">기본정보</a></li>

<li><a href="#anc_sitfrm_compact">요약정보</a></li>

<li><a href="#anc_sitfrm_cost">가격 및 재고</a></li>

<li><a href="#anc_sitfrm_sendcost">배송비</a></li>

<li><a href="#anc_sitfrm_img">상품이미지</a></li>

<li><a href="#anc_sitfrm_relation">관련상품</a></li>

<li><a href="#anc_sitfrm_event">관련이벤트</a></li>

<li><a href="#anc_sitfrm_optional">상세설명설정</a></li>

<li><a href="#anc_sitfrm_extra">여분필드</a></li>

</ul>

';


$frm_submit = '<div class="btn_confirm01 btn_confirm">

    <input type="submit" value="확인" class="btn_submit" accesskey="s">

    <a href="./itemlist.php?'.$qstr.'">목록</a>';

if($it_id)

    $frm_submit .= PHP_EOL.'<a href="'.G5_SHOP_URL.'/item.php?it_id='.$it_id.'" class="btn_frmline">상품보기</a>';

$frm_submit .= '</div>';



?>


<form name="fitemform" action="./itemformupdate.php" method="post" enctype="MULTIPART/FORM-DATA" autocomplete="off" onsubmit="return fitemformcheck(this)">


<input type="hidden" name="codedup" value="<?php echo $default['de_code_dup_use']; ?>">

<input type="hidden" name="w" value="<?php echo $w; ?>">

<input type="hidden" name="sca" value="<?php echo $sca; ?>">

<input type="hidden" name="sst" value="<?php echo $sst; ?>">

<input type="hidden" name="sod"  value="<?php echo $sod; ?>">

<input type="hidden" name="sfl" value="<?php echo $sfl; ?>">

<input type="hidden" name="stx"  value="<?php echo $stx; ?>">

<input type="hidden" name="page" value="<?php echo $page; ?>">


<section id="anc_sitfrm_cate">

    <h2 class="h2_frm">상품분류</h2>

    <?php echo $pg_anchor; ?>

    <div class="local_desc02 local_desc">

        <p>기본분류는 반드시 선택하셔야 합니다. 하나의 상품에 최대 3개의 다른 분류를 지정할 수 있습니다.</p>

    </div>


    <div class="tbl_frm01 tbl_wrap">

        <table>

        <caption>상품분류 입력</caption>

        <colgroup>

            <col class="grid_4">

            <col>

        </colgroup>

        <tbody>

        <tr>

            <th scope="row"><label for="ca_id">기본분류</label></th>

            <td>

                <?php if ($w == "") echo help("기본분류를 선택하면, 판매/재고/HTML사용/판매자 E-mail 등을, 선택한 분류의 기본값으로 설정합니다."); ?>

                <select name="ca_id" id="ca_id" onchange="categorychange(this.form)">

                    <option value="">선택하세요</option>

                    <?php echo conv_selected_option($category_select, $it['ca_id']); ?>

                </select>

                <script>

                    var ca_use = new Array();

                    var ca_stock_qty = new Array();

                    //var ca_explan_html = new Array();

                    var ca_sell_email = new Array();

                    var ca_opt1_subject = new Array();

                    var ca_opt2_subject = new Array();

                    var ca_opt3_subject = new Array();

                    var ca_opt4_subject = new Array();

                    var ca_opt5_subject = new Array();

                    var ca_opt6_subject = new Array();

                    <?php echo "\n$script"; ?>

                </script>

            </td>

        </tr>


        <tr>

            <th scope="row"><label for="ca_id2">신제품</label></th>

            <td>

                <?php echo help('식중독지수전광판, 모범음식점간판, 3d프린터, 휠복합면취경면기, 헤비슬로팅머신 카테고리 중 맞는 것을 선택해주세요'); ?>

                <select name="ca_id2" id="ca_id2">

                    <option value="">선택하세요</option>

                    <option value="60" <? if($it['ca_id2']=="60") echo " selected" ?> >신제품</option>

<option value="6010" <? if($it['ca_id2']=="6010") echo " selected" ?> >   식중독지수전광판</option>

<option value="6020" <? if($it['ca_id2']=="6020") echo " selected" ?> >   모범음식점간판</option>

<option value="6030" <? if($it['ca_id2']=="6030") echo " selected" ?> >   3D프린터</option>

<option value="6040" <? if($it['ca_id2']=="6040") echo " selected" ?> >   휠복합면취경면기</option>

<option value="6050" <? if($it['ca_id2']=="6050") echo " selected" ?> >   헤비슬로팅머신</option>

                </select>

            </td>

        </tr>


        </tbody>

        </table>

    </div>

</section>



<?php echo $frm_submit; ?>


<section id="anc_sitfrm_ini">

    <h2 class="h2_frm">기본정보</h2>

    <?php echo $pg_anchor; ?>

    <div class="tbl_frm01 tbl_wrap">

        <table>

        <caption>기본정보 입력</caption>

        <colgroup>

            <col class="grid_4">

            <col>

            <col class="grid_3">

        </colgroup>

        <tbody>

        <tr>

            <th scope="row">상품코드</th>

            <td colspan="2">

                <?php if ($w == '') { // 추가 ?>

                    <!-- 최근에 입력한 코드(자동 생성시)가 목록의 상단에 출력되게 하려면 아래의 코드로 대체하십시오. -->

                    <!-- <input type=text class=required name=it_id value="<?php echo 10000000000-time()?>" size=12 maxlength=10 required> <a href='javascript:;' onclick="codedupcheck(document.all.it_id.value)"><img src='./img/btn_code.gif' border=0 align=absmiddle></a> -->

                    <?php echo help("상품의 코드는 10자리 숫자로 자동생성합니다. <b>직접 상품코드를 입력할 수도 있습니다.</b>\n상품코드는 영문자, 숫자, - 만 입력 가능합니다."); ?>

                    <input type="text" name="it_id" value="<?php echo time(); ?>" id="it_id" required class="frm_input required" size="20" maxlength="20">

                    <!-- <?php if ($default['de_code_dup_use']) { ?><button type="button" class="btn_frmline" onclick="codedupcheck(document.all.it_id.value)">중복검사</a><?php } ?> -->

                <?php } else { ?>

                    <input type="hidden" name="it_id" value="<?php echo $it['it_id']; ?>">

                    <span class="frm_ca_id"><?php echo $it['it_id']; ?></span>

                    <a href="<?php echo G5_SHOP_URL; ?>/item.php?it_id=<?php echo $it_id; ?>" class="btn_frmline">상품확인</a>

                    <a href="<?php echo G5_ADMIN_URL; ?>/shop_admin/itemuselist.php?sfl=a.it_id&stx=<?php echo $it_id; ?>" class="btn_frmline">사용후기</a>

                    <a href="<?php echo G5_ADMIN_URL; ?>/shop_admin/itemqalist.php?sfl=a.it_id&stx=<?php echo $it_id; ?>" class="btn_frmline">상품문의</a>

                <?php } ?>

            </td>

        </tr>

        <tr>

            <th scope="row"><label for="it_name">상품명</label></th>

            <td colspan="2">

                <?php echo help("HTML 입력이 불가합니다."); ?>

                <input type="text" name="it_name" value="<?php echo get_text(cut_str($it['it_name'], 250, "")); ?>" id="it_name" required class="frm_input required" size="95">

            </td>

        </tr>

        <tr>

            <th scope="row"><label for="it_basic">기본설명</label></th>

            <td>

                <?php echo help("상품명 하단에 상품에 대한 추가적인 설명이 필요한 경우에 입력합니다. HTML 입력도 가능합니다."); ?>

                <input type="text" name="it_basic" value="<?php echo get_text($it['it_basic']); ?>" id="it_basic" class="frm_input" size="95">

            </td>

            <td class="td_grpset">

                <input type="checkbox" name="chk_ca_it_basic" value="1" id="chk_ca_it_basic">

                <label for="chk_ca_it_basic">분류적용</label>

                <input type="checkbox" name="chk_all_it_basic" value="1" id="chk_all_it_basic">

                <label for="chk_all_it_basic">전체적용</label>

            </td>

        </tr>

        

        <tr>

            <th scope="row">상품유형</th>

            <td>

                <?php echo help("메인화면에 유형별로 출력할때 사용합니다.\n이곳에 체크하게되면 상품리스트에서 유형별로 정렬할때 체크된 상품이 가장 먼저 출력됩니다."); ?>

               <input type="checkbox" name="it_type2" value="1" <?php echo ($it['it_type2'] ? "checked" : ""); ?> id="it_type2">

                <label for="it_type2">추천상품 <img src="<?php echo G5_SHOP_URL; ?>/img/icon_rec.gif" alt=""></label>


                <input type="checkbox" name="it_type3" value="1" <?php echo ($it['it_type3'] ? "checked" : ""); ?> id="it_type3">

                <label for="it_type3">신상품 <img src="<?php echo G5_SHOP_URL; ?>/img/icon_new.gif" alt=""></label>

                

                <input type="checkbox" name="it_type4" value="1" <?php echo ($it['it_type4'] ? "checked" : ""); ?> id="it_type4">

                <label for="it_type4">인기상품 <img src="<?php echo G5_SHOP_URL; ?>/img/icon_best.gif" alt=""></label>

                

                <input type="checkbox" name="it_type5" value="1" <?php echo ($it['it_type5'] ? "checked" : ""); ?> id="it_type5">

                <label for="it_type5">할인상품 <img src="<?php echo G5_SHOP_URL; ?>/img/icon_discount.gif" alt=""></label>

            </td>

            <td class="td_grpset">

                <input type="checkbox" name="chk_ca_it_type" value="1" id="chk_ca_it_type">

                <label for="chk_ca_it_type">분류적용</label>

                <input type="checkbox" name="chk_all_it_type" value="1" id="chk_all_it_type">

                <label for="chk_all_it_type">전체적용</label>

            </td>

        </tr>

        <tr>

            <th scope="row"><label for="it_maker">제조사</label></th>

            <td>

                <?php echo help("입력하지 않으면 상품상세페이지에 출력하지 않습니다."); ?>

                <input type="text" name="it_maker" value="<?php echo get_text($it['it_maker']); ?>" id="it_maker" class="frm_input" size="40">

            </td>

            <td class="td_grpset">

                <input type="checkbox" name="chk_ca_it_maker" value="1" id="chk_ca_it_maker">

                <label for="chk_ca_it_maker">분류적용</label>

                <input type="checkbox" name="chk_all_it_maker" value="1" id="chk_all_it_maker">

                <label for="chk_all_it_maker">전체적용</label>

            </td>

        </tr>

        <tr>

            <th scope="row"><label for="it_origin">원산지</label></th>

            <td>

                <?php echo help("입력하지 않으면 상품상세페이지에 출력하지 않습니다."); ?>

                <input type="text" name="it_origin" value="<?php echo get_text($it['it_origin']); ?>" id="it_origin" class="frm_input" size="40">

            </td>

            <td class="td_grpset">

                <input type="checkbox" name="chk_ca_it_origin" value="1" id="chk_ca_it_origin">

                <label for="chk_ca_it_origin">분류적용</label>

                <input type="checkbox" name="chk_all_it_origin" value="1" id="chk_all_it_origin">

                <label for="chk_all_it_origin">전체적용</label>

            </td>

        </tr>

        <tr>

            <th scope="row"><label for="it_brand">브랜드</label></th>

            <td>

                <?php echo help("입력하지 않으면 상품상세페이지에 출력하지 않습니다."); ?>

                <input type="text" name="it_brand" value="<?php echo get_text($it['it_brand']); ?>" id="it_brand" class="frm_input" size="40">

            </td>

            <td class="td_grpset">

                <input type="checkbox" name="chk_ca_it_brand" value="1" id="chk_ca_it_brand">

                <label for="chk_ca_it_brand">분류적용</label>

                <input type="checkbox" name="chk_all_it_brand" value="1" id="chk_all_it_brand">

                <label for="chk_all_it_brand">전체적용</label>

            </td>

        </tr>

        <tr>

            <th scope="row"><label for="it_model">모델</label></th>

            <td>

                <?php echo help("입력하지 않으면 상품상세페이지에 출력하지 않습니다."); ?>

                <input type="text" name="it_model" value="<?php echo get_text($it['it_model']); ?>" id="it_model" class="frm_input" size="40">

            </td>

            <td class="td_grpset">

                <input type="checkbox" name="chk_ca_it_model" value="1" id="chk_ca_it_model">

                <label for="chk_ca_it_model">분류적용</label>

                <input type="checkbox" name="chk_all_it_model" value="1" id="chk_all_it_model">

                <label for="chk_all_it_model">전체적용</label>

            </td>

        </tr>

        <tr>

            <th scope="row"><label for="it_tel_inq">전화문의</label></th>

            <td>

                <?php echo help("상품 금액 대신 전화문의로 표시됩니다."); ?>

                <input type="checkbox" name="it_tel_inq" value="1" id="it_tel_inq" <?php echo ($it['it_tel_inq']) ? "checked" : ""; ?>> 예

            </td>

            <td class="td_grpset">

                <input type="checkbox" name="chk_ca_it_tel_inq" value="1" id="chk_ca_it_tel_inq">

                <label for="chk_ca_it_tel_inq">분류적용</label>

                <input type="checkbox" name="chk_all_it_tel_inq" value="1" id="chk_all_it_tel_inq">

                <label for="chk_all_it_tel_inq">전체적용</label>

            </td>

        </tr>

        <tr>

            <th scope="row"><label for="it_use">판매가능</label></th>

            <td>

                <?php echo help("잠시 판매를 중단하거나 재고가 없을 경우에 체크를 해제해 놓으면 출력되지 않으며, 주문도 받지 않습니다."); ?>

                <input type="checkbox" name="it_use" value="1" id="it_use" <?php echo ($it['it_use']) ? "checked" : ""; ?>> 예

            </td>

            <td class="td_grpset">

                <input type="checkbox" name="chk_ca_it_use" value="1" id="chk_ca_it_use">

                <label for="chk_ca_it_use">분류적용</label>

                <input type="checkbox" name="chk_all_it_use" value="1" id="chk_all_it_use">

                <label for="chk_all_it_use">전체적용</label>

            </td>

        </tr>

        

        <tr>

            <th scope="row">상품설명</th>

            <td colspan="2"> <?php echo editor_html('it_explan', get_text($it['it_explan'], 0)); ?></td>

        </tr>

        

         </tbody>

        </table>

    </div>

</section>




<section id="anc_sitfrm_cost">

    <h2 class="h2_frm">가격 및 재고</h2>

    <?php echo $pg_anchor; ?>


    <div class="tbl_frm01 tbl_wrap">

        <table>

        <caption>가격 및 재고 입력</caption>

        <colgroup>

            <col class="grid_4">

            <col>

            <col class="grid_3">

        </colgroup>

        <tbody>

        <tr>

            <th scope="row"><label for="it_price">판매가격</label></th>

            <td>

이 질문에 댓글 쓰기 :

답변 1

$sql = " select ca_id, ca_id2 from {$g5['g5_shop_category_table']} order by ca_order, ca_id limit 1 ";

이 줄에서 오류가 나는 건데요, 영카트 원본 파일에는

select ca_id from 이렇게 되어 있습니다.

ca_id2라는 칼럼은 영카트 원본에 없는 겁니다.

저거 지우고 사용해 보세요.

[수정]

$sql = " select ca_id from {$g5['g5_shop_category_table']} order by ca_order, ca_id limit 1 "; 

답변을 작성하시기 전에 로그인 해주세요.
전체 60,013
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT