총게시물 수, 총 댓글수 뽑기 정보
총게시물 수, 총 댓글수 뽑기관련링크
http://phil114.com/
178회 연결
본문
<?
//게시물수 뽑기
$results1 = sql_query(" SELECT bo_table FROM $g4[board_table] ");
$all_com = 0;
$all_art= 0;
$i=0;
while ($row13 = sql_fetch_array($results1)) {
$i++; //테이블수
//게시물
$gul_su="select count(wr_is_comment) as ctt from g4_write_$row13[bo_table] where wr_is_comment='0' ";
//코멘트
$co_su="select sum(wr_is_comment) as ctt2 from g4_write_$row13[bo_table] where wr_is_comment='1' ";
//게시물
$article = sql_fetch($gul_su);
$article_su=$article[ctt];
$all_art= $all_art +$article_su;
//코멘트
$comm= sql_fetch($co_su);
$comm_su=$comm[ctt2];
$all_com = $all_com+$comm_su;
}
?>
<table width=100%>
<tr>
<td align=right>
<span style='font-family:돋움;font-size:11px;color:#999999;'>· 총게시물 :</span></td>
<td align=right> <span style='font-family:돋움;font-size:11px;color:#999999;'>
<?=number_format($all_art)?> </span></td>
<td align=right>
<span style='font-family:돋움;font-size:11px;color:#999999;'>· 총코멘트 :</span> </td>
<td align=right>
<span style='font-family:돋움;font-size:11px;color:#999999;'>
<?=number_format($all_com)?> </span></td>
</tr>
</table>
//게시물수 뽑기
$results1 = sql_query(" SELECT bo_table FROM $g4[board_table] ");
$all_com = 0;
$all_art= 0;
$i=0;
while ($row13 = sql_fetch_array($results1)) {
$i++; //테이블수
//게시물
$gul_su="select count(wr_is_comment) as ctt from g4_write_$row13[bo_table] where wr_is_comment='0' ";
//코멘트
$co_su="select sum(wr_is_comment) as ctt2 from g4_write_$row13[bo_table] where wr_is_comment='1' ";
//게시물
$article = sql_fetch($gul_su);
$article_su=$article[ctt];
$all_art= $all_art +$article_su;
//코멘트
$comm= sql_fetch($co_su);
$comm_su=$comm[ctt2];
$all_com = $all_com+$comm_su;
}
?>
<table width=100%>
<tr>
<td align=right>
<span style='font-family:돋움;font-size:11px;color:#999999;'>· 총게시물 :</span></td>
<td align=right> <span style='font-family:돋움;font-size:11px;color:#999999;'>
<?=number_format($all_art)?> </span></td>
<td align=right>
<span style='font-family:돋움;font-size:11px;color:#999999;'>· 총코멘트 :</span> </td>
<td align=right>
<span style='font-family:돋움;font-size:11px;color:#999999;'>
<?=number_format($all_com)?> </span></td>
</tr>
</table>
추천
2
2
댓글 2개
요게 각 회원들이 작성한 총 게시물과 코멘트를 출력하는 소스인가요?
정말 유용한팁!
감사합니다~~~~~
감사합니다~~~~~