총 게시글 / 댓글 구하는 방법이 무엇인가요?
본문
검색을 해서 나온 소스들을 대입 해보는데 잘 안되네요 ㅠㅜ
관리자 페이지에서 총 게시글과 총 댓글 수를 표시하고 싶은데 도움 좀 부탁드립니다.
검색 능력도 부족 한가 봅니다 ㅠㅜ
답변 1
<?php
// 총게시물수
$write_total = sql_fetch(" select sum(bo_count_write) as sum_count_write from {$g5['board_table']} ");
$total_cnt = $write_total['sum_count_write'];
// 총코멘트수
$comment_total = sql_fetch(" select sum(bo_count_comment) as sum_count_comment from {$g5['board_table']} ");
$total_cnt2 = $comment_total['sum_count_comment'];
?>
총게시물수 : <?php echo number_format($total_cnt); ?>
총코멘트수 : <?php echo number_format($total_cnt2); ?>
참고
http://gnustudy.com/bbs/board.php?bo_table=gnu_tip&wr_id=132
답변을 작성하시기 전에 로그인 해주세요.