index화면에 특정 게시판의 게시물 수를 가져오고싶습니다.
본문
index화면에 a라는 게시판의 총 게시물수를 가져오고싶습니다
어떠한 방법이있을까요?
검색을 해보았는데 잘안되어서 질문드립니다.
답변 2
$write_total = sql_fetch(" select bo_count_write from {$g5['board_table']} where bo_table = '특정게시판id' ");
echo $write_total['bo_count_write'];
예를들어 자유게시판이고 댓글의 숫자를 제외하시려면...
<?php
$total = sql_fetch("select count(*) as cnt from g5_write_free_board where wr_is_comment = 0");
echo "".number_format($total[cnt])."";
?>
예를들어 자유게시판이고 댓글의 숫자를 포함하시려면...
<?php
$total = sql_fetch("select count(*) as cnt from g5_write_free_board");
echo "".number_format($total[cnt])."";
?>
예전에 작은별님께 배운 것 입니다.
답변을 작성하시기 전에 로그인 해주세요.