[G5] 그누보드에서 G4S로 이전시 첨부파일 출력 업데이트
-
웹스터디 / 2013.07.19 10:48 / hit 5,491 추천 0
- http://sir.co.kr/bbs/board.php?bo_table=g4s_qa&wr_id=848 (1037)
- [g4s]wr_file_update.php (765byte) () DATE : 2013-07-19 10:47:59
그누보드에서 G4S로 이전시 첨부파일 출력 업데이트
<?php
include_once('./_common.php');
if(!$is_admin) {
exit;
}
$bo_table = "";
$sql = " select bo_table from $g4[board_table]";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$result_file = sql_query("select distinct(wr_id) from $g4[board_file_table] where bo_table='$row[bo_table]'");
for($j=0;$res=sql_fetch_array($result_file);$j++) {
$file_cnt = sql_fetch("select count(*) as cnt from $g4[board_file_table] where bo_table='$row[bo_table]' and wr_id='$res[wr_id]'");
$bo_table = $g4['write_prefix'] . $row[bo_table];
sql_query("update $bo_table set wr_file='$file_cnt[cnt]' where wr_id='$res[wr_id]'");
}
}
echo "wr_file 필드에 파일수를 업데이트 하였습니다.";
?>