웹프로그래밍

Global It Leader!!


그누보드


 
 

게시판 합치기 팁

페이지 정보

작성자 no_profile 오원장 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 댓글 0건 조회 4,238회 작성일 14-03-21 13:20

본문

<?
include "_common.php";
//table1에 table2의 레코드를 가져와 합치는 소스
$bo_tableA="table1";
$bo_tableB="table2";
$write_tableA=$g4[write_prefix].$bo_tableA;
$write_tableB=$g4[write_prefix].$bo_tableB;
 
sql_query("lock tables $write_tableA write,$write_tableB write ", false);
 $row=sql_fetch("select max(wr_id) as cnt from $write_tableA");
 $plusCnt= $row[cnt] + 100;
echo $write_tableB.'==>'.$write_tableA.'<p>';
echo "<hr>";
 sql_query("INSERT INTO $write_tableA (wr_id ,wr_num, wr_reply, wr_parent ,wr_is_comment, wr_comment ,wr_comment_reply ,ca_name,wr_option,wr_subject,wr_content,wr_link1,wr_link2,wr_link1_hit,wr_link2_hit,wr_trackback,wr_hit,wr_good,wr_nogood,mb_id,wr_password,wr_name,wr_email,wr_homepage,wr_datetime,wr_last,wr_ip,wr_1,wr_2,wr_3,wr_4,wr_5,wr_6,wr_7,wr_8,wr_9,wr_10 )
    select wr_id+$plusCnt, wr_num-$plusCnt,wr_reply, wr_parent+$plusCnt,wr_is_comment,wr_comment,wr_comment_reply,ca_name,wr_option,wr_subject,wr_content,wr_link1,wr_link2,wr_link1_hit,wr_link2_hit,wr_trackback,wr_hit,wr_good,wr_nogood,mb_id,wr_password,wr_name,wr_email,wr_homepage,wr_datetime,wr_last,wr_ip,wr_1,wr_2,wr_3,wr_4,wr_5,wr_6,wr_7,wr_8,wr_9,wr_10  from $write_tableB ");
sql_query(" unlock tables ", false);

$filePathA=$g4[path].'/data/file/'.$bo_tableA;
$filePathB=$g4[path].'/data/file/'.$bo_tableB;
$dir=@opendir($filePathB);
while($file=readdir($dir)) {
    if ($file=='.' || $file=='..') continue;
    echo 'file copy : '.$file.'<br>';
    @copy($filePathB.'/'.$file, $filePathA.'/'.$file);
    @unlink($filePathB.'/'.$file);
}
sql_query("update $g4[board_file_table] set bo_table='$bo_tableA', wr_id = wr_id + $plusCnt where bo_table='$bo_tableB'");
?>
<hr>
OK

댓글목록

등록된 댓글이 없습니다.

전체 59
게시물 검색
그누보드 목록
번호 제목 글쓴이 조회 날짜
59 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 31 03-22
58 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 28 03-22
57 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 127 01-12
56 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 140 01-11
55 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 124 01-11
54 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 251 10-29
53 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 354 09-14
52 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 387 08-21
51 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 392 08-06
50 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 361 08-05
49 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2007 03-22
48 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1287 03-22
47 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4578 08-09
46 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1879 07-22
45 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3935 07-16
44 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2151 06-28
43 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 1935 06-20
42 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2379 04-06
41 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2654 02-07
40 no_profile 운영자 쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2679 02-03