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

A게시판 글작성시 B게시판에도 등록되게 해놓았는데 글쓰기 후 다른글이 보입니다 채택완료

신발떨이 9년 전 조회 5,383

 

 

전에 이 기능을 추가하기위해서 문의글을 올렸었는데 ( http://sir.kr/qa/119995">http://sir.kr/qa/119995 )

그림자밟기님이 답변을 해주셨으나 아직 수정할때 업데이트는 커녕 구현도 완료하지 못했습니다..

 

A게시판에 작성시 B게시판에 글이 작성되는건 잘 되고있습니다.

그런데 A게시판에 글쓰기를 완료하면 방금 쓴 글 내용이 아니라 이전에 작성했던 다른글로 이동됩니다

 

그래서 wr_num같은게 꼬인건가 해서 A게시판과 B게시판의 글을 모두 지워버렸습니다

그렇게 하니 이번엔 '글이 존재하지 않습니다. 글이 삭제되었거나 이동된 경우입니다'

라고 오류창이 뜹니다.

 

아래 코드는 A게시판스킨에 적용한 write_update_skin 내용입니다

한두군데만 고치면 될것같은데 어디를 고쳐야할지 모르겠습니다

도움 부탁드립니다 ㅜㅜ

 

 

 

 

 

 </span><span style="font-size: 14.6667px; line-height: 22px;"><?</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">$sql_add = " insert into 게시판B테이블</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                set wr_num = '$wr_num',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_reply = '$wr_reply',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_comment = 0,</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     ca_name = '$ca_name',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_option = '$html,$secret,$mail',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_subject = '$wr_subject',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_content = '$wr_content',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_link1 = '$wr_link1',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_link2 = '$wr_link2',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_link1_hit = 0,</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_link2_hit = 0,</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_hit = 0,</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_good = 0,</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_nogood = 0,</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     mb_id = '{$member['mb_id']}',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_password = '$wr_password',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_name = '$wr_name',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_email = '$wr_email',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_homepage = '$wr_homepage',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_datetime = '".G5_TIME_YMDHIS."',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_last = '".G5_TIME_YMDHIS."',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_ip = '{$_SERVER['REMOTE_ADDR']}',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_1 = '$wr_1',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_2 = '$wr_2',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_3 = '$wr_3',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_4 = '$wr_4',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_5 = '$wr_5',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_6 = '$wr_6',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_7 = '$wr_7',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_8 = '$wr_8',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_9 = '$wr_9',</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">                     wr_10 = '$wr_10'";</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">sql_query($sql_add);</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </span></p><p><span style="font-size: 14.6667px; line-height: 22px;">$wr_id = sql_insert_id();</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </span></p><p><span style="font-size: 14.6667px; line-height: 22px;">// 부모 아이디에 UPDATE</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">sql_query(" update 게시판B테이블 set wr_parent = '$wr_id' where wr_id = '$wr_id' ");</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </span></p><p><span style="font-size: 14.6667px; line-height: 22px;">// 새글 INSERT</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">sql_query(" insert into 게시판B테이블 ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '{$bo_table}', '{$wr_id}', '{$wr_id}', '".G5_TIME_YMDHIS."', '{$member['mb_id']}' ) ");</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </span></p><p><span style="font-size: 14.6667px; line-height: 22px;">// 게시글 1 증가</span></p><p><span style="font-size: 14.6667px; line-height: 22px;">sql_query("update {$g5['board_table']} set bo_count_write = bo_count_write + 1 where bo_table = '{$bo_table}'");</span></p><p><span style="font-size: 14.6667px; line-height: 22px;"> </span></p><p><span style="font-size: 14.6667px; line-height: 22px;">?> </span><span style="font-size: 14.6667px; line-height: 1.5;"> 

 

 

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

답변 1개

신발떨이

해결했습니다...

 

아무리봐도 모르겠고 코드수정하면 동시에 글 올려지던게 안올라와지고 해서..

phpmyadmin좀 보다가 a게시판과 b게시판의 wr_id가 서로 다르더라구요

그누보드에서 글을 삭제해도 정보가 남아있는지 삭제된 글의 다음 wr_id부터 시작해서

테이블 작업에서 최적화, 복구 해도 안됐었는데 테이블 비우기를 선택하니 잘 되네요

 

많은 관심 감사드립니다

 

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

답변에 대한 댓글 1개

신발떨이
9년 전
혹시 수정이나 삭제시 반영하는 방법 아시는분 계시면 도움좀 부탁드립니다

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

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

로그인