답변 1개 / 댓글 2개
채택된 답변
+20 포인트
5년 전
Copy
$board_total_count = 0;
$sql = "select bo_table from g5_board";
$result = sql_query($sql);
while($row = sql_fetch_array($result)){
$w_table = $g5['write_prefix'] . $row['bo_table'];
$res = sql_fetch("select sum(wr_hit) as cnt from $w_table where wr_is_comment = 0");
$board_total_count+=$res['cnt'];
}
echo "합산조회수 : {$board_total_count}";
답변에 대한 댓글 2개
늙은호랑이
5년 전
5년 전
$w_table = $g5['write_prefix'] . '게시판bo_table';
$res = sql_fetch("select sum(wr_hit) as cnt from $w_table where wr_is_comment = 0");
echo $res['cnt'];
$res = sql_fetch("select sum(wr_hit) as cnt from $w_table where wr_is_comment = 0");
echo $res['cnt'];
답변을 작성하려면 로그인이 필요합니다.
감사합니다.