|
|
|
19년 전
|
조회 1,543
|
|
|
|
19년 전
|
조회 1,552
|
|
|
|
19년 전
|
조회 2,140
|
|
|
|
19년 전
|
조회 1,032
|
|
|
|
19년 전
|
조회 1,756
|
|
|
|
19년 전
|
조회 1,632
|
|
|
|
19년 전
|
조회 1,440
|
|
|
|
19년 전
|
조회 1,136
|
|
|
|
19년 전
|
조회 1,199
|
|
|
|
19년 전
|
조회 1,627
|
|
|
|
19년 전
|
조회 2,141
|
|
|
|
19년 전
|
조회 2,747
|
|
|
|
19년 전
|
조회 1,545
|
|
|
|
19년 전
|
조회 1,450
|
|
|
|
19년 전
|
조회 1,645
|
|
|
|
19년 전
|
조회 1,087
|
|
|
|
19년 전
|
조회 1,216
|
|
|
|
19년 전
|
조회 1,372
|
|
|
|
19년 전
|
조회 1,619
|
|
|
|
19년 전
|
조회 1,574
|
댓글 3개
으로 테이블마다 합계를 구하시면 될듯...
대부분의 쿼리들이 이런 식으로 시작을 하지만 끝이 없죠.
<table width="100%" cellpadding=0 cellspacing=0>
<tr>
<td width="100%" style="word-break:break-all; padding-left:0px;" wrap>
<?
$rowbd=array();
$sql2 = "select bo_table, bo_subject from $g4[board_table] order by gr_id, bo_table ";
$result2 = sql_query($sql2);
for($i=0; $row2=sql_fetch_array($result2); $i++) {
$tmp_write_table ="";
$tmp_write_table = $g4[write_prefix] . $row2[bo_table];
//$sql3 = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
//explain($sql3);
$old_wr_hit=$res_wr_hit; $res_wr_hit="";
$tmp_wr_hit=@mysql_result(@mysql_query("select sum(wr_hit) from $tmp_write_table"),0,0);
$res_wr_hit=$old_wr_hit+$tmp_wr_hit;
$rowbd[bo_subject_name][$i]= $row2[bo_subject]; //보드명
$rowbd[bo_table_wr_hit][$i]=$tmp_wr_hit; // 보드별 뷰카운터
$rowbd[bo_table][$i]=$row2[bo_table];
}//for
echo"<br><b>게시물 총 뷰카운트:<font color='red'>$res_wr_hit </font>회</b><br>";
for($i=0; $i<mysql_num_rows($result2); $i++){
echo"<a href='$g4[bbs_path]/board.php?bo_table={$rowbd[bo_table][$i]}'</a>";
echo"{$rowbd[bo_subject_name][$i]} (<font color='#003366'>{$rowbd[bo_table_wr_hit][$i]}</font>)<br>";
}
?>
</td></tr></table>