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

영카트5 DB테이블에 자료 저장이 안됩니다. 채택완료

웃음보약 7년 전 조회 3,787

http://www.sachul.com/shop/item.php?it_id=1518159542

견적요청 창에서 자료를 입력하고 작성저장을 클릭하면 저장되었다는 

메세지는 나오는데 실제 테이블에는 자료가 저장되지 않습니다.

뭐가 문제일까요?

상품문의(qa)와 동일한 구조의 폼(회사명 추가)과 동일한 구조의 테이블을 사용하고 있습니다.

 

</p>

<p><?php

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

<p>if (!$is_member) {

    alert_close("견적요청은 회원만 작성이 가능합니다.");

}</p>

<p>$qt_id = (int) trim($_REQUEST['qt_id']);

$qt_company = trim($_POST['qt_company']);

$qt_subject = trim($_POST['qt_subject']);

$qt_question = trim($_POST['qt_question']);

$qt_answer = trim($_POST['qt_answer']);

$hash = trim($_REQUEST['hash']);

$get_editor_img_mode = $config['cf_editor'] ? false : true;</p>

<p>if ($w == "" || $w == "u") {

    $qt_name     = addslashes(strip_tags($member['mb_name']));

    $qt_password = $member['mb_password'];

    if (!$qt_company) alert("회사명을 입력하여 주십시오.");

    if (!$qt_subject) alert("제목을 입력하여 주십시오.");

    if (!$qt_question) alert("요청내용을 입력하여 주십시오.");

}</p>

<p>if($is_mobile_shop)

    $url = './iteminfo.php?it_id='.$it_id.'&info=quotation';

else

    $url = "./item.php?it_id=$it_id&_=".get_token()."#sit_qt";</p>

<p>if ($w == "")

{

    $sql = "insert {$g5['g5_shop_item_quotation_table']}

               set it_id = '$it_id',

                   mb_id = '{$member['mb_id']}',

                   qt_secret = '$qt_secret',

                   qt_name  = '$qt_name',

                   qt_company  = '$qt_company',

                   qt_email = '$qt_email',

                   qt_hp = '$qt_hp',

                   qt_password  = '$qt_password',

                   qt_subject  = '$qt_subject',

                   qt_question = '$qt_question',

                   qt_time = '".G5_TIME_YMDHIS."',

                   qt_ip = '$REMOTE_ADDR' ";

    sql_query($sql);</p>

<p>    $alert_msg = '견적요청이 등록 되었습니다.';

}

else if ($w == "u")

{

    if (!$is_admin)

    {

        $sql = " select count(*) as cnt from {$g5['g5_shop_item_quotation_table']} where mb_id = '{$member['mb_id']}' and qt_id = '$qt_id' ";

        $row = sql_fetch($sql);

        if (!$row['cnt'])

            alert("자신의 제품문의만 수정하실 수 있습니다.");

    }</p>

<p>    $sql = " update {$g5['g5_shop_item_quotation_table']}

                set qt_secret = '$qt_secret',

                    qt_company = '$qt_company',

                    qt_email = '$qt_email',

                    qt_hp = '$qt_hp',

                    qt_subject = '$qt_subject',

                    qt_question = '$qt_question'

              where qt_id = '$qt_id' ";

    sql_query($sql);</p>

<p>    $alert_msg = '견적요청이 수정 되었습니다.';

}

else if ($w == "d")

{

    if (!$is_admin)

    {

        $sql = " select qt_answer from {$g5['g5_shop_item_quotation_table']} where mb_id = '{$member['mb_id']}' and qt_id = '$qt_id' ";

        $row = sql_fetch($sql);

        if (!$row)

            alert("자신의 견적요청만 삭제하실 수 있습니다.");</p>

<p>        if ($row['qt_answer'])

            alert("답변이 있는 견적요청은 삭제하실 수 없습니다.");

    }</p>

<p>    // 에디터로 첨부된 이미지 삭제

    $sql = " select qt_question, qt_answer from {$g5['g5_shop_item_quotation_table']} where qt_id = '$qt_id' and md5(concat(qt_id,qt_time,qt_ip)) = '{$hash}' ";

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

<p>    $imgs = get_editor_image($row['qt_question'], $get_editor_img_mode);</p>

<p>    for($i=0;$i<count($imgs[1]);$i++) {

        $p = parse_url($imgs[1][$i]);

        if(strpos($p['path'], "/data/") != 0)

            $data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);

        else

            $data_path = $p['path'];</p>

<p>        if( preg_match('/(gif|jpe?g|bmp|png)$/i', strtolower(end(explode('.', $data_path))) ) ){</p>

<p>            $destfile = ( ! preg_match('/\w+\/\.\.\//', $data_path) ) ? G5_PATH.$data_path : '';</p>

<p>            if($destfile && preg_match('/\/data\/editor\/[A-Za-z0-9_]{1,20}\//', $destfile) && is_file($destfile))

                @unlink($destfile);

        }

    }</p>

<p>    $imgs = get_editor_image($row['qt_answer'], $get_editor_img_mode);</p>

<p>    for($i=0;$i<count($imgs[1]);$i++) {

        $p = parse_url($imgs[1][$i]);

        if(strpos($p['path'], "/data/") != 0)

            $data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);

        else

            $data_path = $p['path'];</p>

<p>        if( preg_match('/(gif|jpe?g|bmp|png)$/i', strtolower(end(explode('.', $data_path))) ) ){</p>

<p>            $destfile = ( ! preg_match('/\w+\/\.\.\//', $data_path) ) ? G5_PATH.$data_path : '';</p>

<p>            if($destfile && preg_match('/\/data\/editor\/[A-Za-z0-9_]{1,20}\//', $destfile) && is_file($destfile))

                @unlink($destfile);

        }

    }</p>

<p>    $sql = " delete from {$g5['g5_shop_item_quotation_table']} where qt_id = '$qt_id' and md5(concat(qt_id,qt_time,qt_ip)) = '{$hash}' ";

    sql_query($sql);</p>

<p>    $alert_msg = '견적요청이 삭제 되었습니다.';

}</p>

<p>if($w == 'd')

    alert($alert_msg, $url);

else

    alert_opener($alert_msg, $url);

?>

 </p>

<p>

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

답변 2개

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

$g5['g5_shop_item_quotation_table']

테이블명이 이건데 혹시 아래 작업하셨나요?

 

실제 테이블 = g5_shop_item_quotation

 

/data/dbconfig.php

</p>

<p>$g5['g5_shop_item_quotation_table'] = G5_SHOP_TABLE_PREFIX.'item_quotation';</p>

<p>

 

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

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

배모씨님, 감사합니다.

말씀하신것처럼 dbconfig.php파일에 등록을 하니 데이터가 저장이 됩니다.

좋은 하루 되세요.

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

답변에 대한 댓글 1개

배모씨
7년 전
잘되신다고 하니 다행입니다~좋은 하루되셔요^^

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

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

로그인