안녕하세요 게시판 글쓰기 질문입니다
본문
product_monitoring이라는 게시판명 및 게시판 스킨을 사용하고 있습니다.
product_monitoring에서 글을 쓰고 new_product로 글을 복사를 했습니다.
product_monitoring에서 글을 수정하면 new_product에 복사된 글도 글이 수정되게 하고 싶은데 어떻게 해야할까요?? 일단 write_update.skin에
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
$sql = "update $write_table
set regularprice = '$regularprice',
saleprice = '$saleprice',
discount = '$discount',
deeplinks = '$deeplinks',
functional = '$functional',
a_shame = '$a_shame',
b_shame = '$b_shame',
c_shame = '$c_shame',
d_shame = '$d_shame',
e_shame = '$e_shame',
f_shame ='$f_shame',
ct_name = '$ct_name',
ct_shame = '$ct_shame',
ct_name2 = '$ct_name2',
ct_shame2 = '$ct_shame2',
ct_name3 = '$ct_name3',
ct_shame3 = '$ct_shame3',
ct_name4 = '$ct_name4',
ct_shame4 = '$ct_shame4',
ct_name5 = '$ct_name5',
ct_shame5 = '$ct_shame5',
ct_name6 = '$ct_name6',
ct_shame6 = '$ct_shame6',
ct_name7 = '$ct_name7',
ct_shame7 = '$ct_shame7',
ct_name8 = '$ct_name8',
ct_shame8 = '$ct_shame8',
ct_name9 = '$ct_name9',
ct_shame9 = '$ct_shame9',
ct_name10 = '$ct_name10',
ct_shame10 = '$ct_shame10',
ct_name11 = '$ct_name11',
ct_shame11 = '$ct_shame11',
ct_name12 = '$ct_name12',
ct_shame12 = '$ct_shame12',
ct_name13 = '$ct_name13',
ct_shame13 = '$ct_shame13',
ct_name14 = '$ct_name14',
ct_shame14 = '$ct_shame14',
ct_name15 = '$ct_name15',
ct_shame15 = '$ct_shame15',
ct_name16 = '$ct_name16',
ct_shame16 = '$ct_shame16',
ct_name17 = '$ct_name17',
ct_shame17 = '$ct_shame17',
ct_name18 = '$ct_name18',
ct_shame18 = '$ct_shame18',
ct_name19 = '$ct_name19',
ct_shame19 = '$ct_shame19',
ct_name20 = '$ct_name20',
ct_shame20 = '$ct_shame20',
ct_name21 = '$ct_name21',
ct_shame21 = '$ct_shame21',
ct_name22 = '$ct_name22',
ct_shame22 = '$ct_shame22',
ct_name23 = '$ct_name23',
ct_shame23 = '$ct_shame23',
ct_name24 = '$ct_name24',
ct_shame24 = '$ct_shame24',
ct_name25 = '$ct_name25',
ct_shame25 = '$ct_shame25',
ct_name26 = '$ct_name26',
ct_shame26 = '$ct_shame26',
ct_name27 = '$ct_name27',
ct_shame27 = '$ct_shame27',
ct_name28 = '$ct_name28',
ct_shame28 = '$ct_shame28',
ct_name29 = '$ct_name29',
ct_shame29 = '$ct_shame29',
ct_name30 = '$ct_name30',
ct_shame30 = '$ct_shame30',
functionalmaterial = '$functionalmaterial',
othermaterials = '$othermaterials',
capsulematerial = '$capsulematerial',
foodadditives = '$foodadditives',
searchkeyword = '$searchkeyword',
nondeeplink = '$nondeeplink',
originallink = '$originallink'
where wr_id = '$wr_id'";
sql_query($sql);
// new_product 테이블에도 업데이트 수행
$new_product_table = $g5_table_prefix . 'new_product'; // new_product 테이블명
$sql_new_product = "update $new_product_table
set regularprice = '$regularprice',
saleprice = '$saleprice',
discount = '$discount',
deeplinks = '$deeplinks',
functional = '$functional',
a_shame = '$a_shame',
b_shame = '$b_shame',
c_shame = '$c_shame',
d_shame = '$d_shame',
e_shame = '$e_shame',
f_shame ='$f_shame',
ct_name = '$ct_name',
ct_shame = '$ct_shame',
ct_name2 = '$ct_name2',
ct_shame2 = '$ct_shame2',
ct_name3 = '$ct_name3',
ct_shame3 = '$ct_shame3',
ct_name4 = '$ct_name4',
ct_shame4 = '$ct_shame4',
ct_name5 = '$ct_name5',
ct_shame5 = '$ct_shame5',
ct_name6 = '$ct_name6',
ct_shame6 = '$ct_shame6',
ct_name7 = '$ct_name7',
ct_shame7 = '$ct_shame7',
ct_name8 = '$ct_name8',
ct_shame8 = '$ct_shame8',
ct_name9 = '$ct_name9',
ct_shame9 = '$ct_shame9',
ct_name10 = '$ct_name10',
ct_shame10 = '$ct_shame10',
ct_name11 = '$ct_name11',
ct_shame11 = '$ct_shame11',
ct_name12 = '$ct_name12',
ct_shame12 = '$ct_shame12',
ct_name13 = '$ct_name13',
ct_shame13 = '$ct_shame13',
ct_name14 = '$ct_name14',
ct_shame14 = '$ct_shame14',
ct_name15 = '$ct_name15',
ct_shame15 = '$ct_shame15',
ct_name16 = '$ct_name16',
ct_shame16 = '$ct_shame16',
ct_name17 = '$ct_name17',
ct_shame17 = '$ct_shame17',
ct_name18 = '$ct_name18',
ct_shame18 = '$ct_shame18',
ct_name19 = '$ct_name19',
ct_shame19 = '$ct_shame19',
ct_name20 = '$ct_name20',
ct_shame20 = '$ct_shame20',
ct_name21 = '$ct_name21',
ct_shame21 = '$ct_shame21',
ct_name22 = '$ct_name22',
ct_shame22 = '$ct_shame22',
ct_name23 = '$ct_name23',
ct_shame23 = '$ct_shame23',
ct_name24 = '$ct_name24',
ct_shame24 = '$ct_shame24',
ct_name25 = '$ct_name25',
ct_shame25 = '$ct_shame25',
ct_name26 = '$ct_name26',
ct_shame26 = '$ct_shame26',
ct_name27 = '$ct_name27',
ct_shame27 = '$ct_shame27',
ct_name28 = '$ct_name28',
ct_shame28 = '$ct_shame28',
ct_name29 = '$ct_name29',
ct_shame29 = '$ct_shame29',
ct_name30 = '$ct_name30',
ct_shame30 = '$ct_shame30',
functionalmaterial = '$functionalmaterial',
othermaterials = '$othermaterials',
capsulematerial = '$capsulematerial',
foodadditives = '$foodadditives',
searchkeyword = '$searchkeyword',
nondeeplink = '$nondeeplink',
originallink = '$originallink'
where wr_id = '$wr_id'";
sql_query($sql_new_product);
alert_close("수정완료");
//alert("수정완료","/bbs/board.php?bo_table=".$bo_table);
?>
이렇게 진행을 해봤는데 적용이 안되서요 뭐가 문제일까요??
!-->답변 2
일단, 2개 테이블의 wr_id 값이 동일한가요?
new_product 에 복사될때 어떤 형태로 복사되는지 모르겠지만, wr_id 값이 동일하게 복사되지 않는다면,
new_product 테이블에 원본 테이블의 wr_id 값을 별도로 보관을 하셔야 합니다.
G5_TABLE_PREFIX 상수 사용해보세요.
답변을 작성하시기 전에 로그인 해주세요.