특정 게시판 자료개수 출력
<?php
function board_count($bo_table){
$Row = sql_fetch(" select bo_count_write from g4_board where bo_table = '".$bo_table."' ");
return $Row['bo_count_write'];
}
echo board_count('notice');
?>
echo board_count('원하는 게시판');
function board_count($bo_table){
$Row = sql_fetch(" select bo_count_write from g4_board where bo_table = '".$bo_table."' ");
return $Row['bo_count_write'];
}
echo board_count('notice');
?>
echo board_count('원하는 게시판');
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인
댓글 7개
소스상에도 에러날문구도 없고 저도 잘사용하고 있으므로~
----------------------------------------------------
<?php
function board_count($bo_table){
$Row = sql_fetch(" select bo_count_write from g4_board where bo_table = '".$bo_table."' ");
return $Row['bo_count_write'];
}
?>
이렇게만 해주시고.. 원하는 위치에 아래처럼
임시게시판 1 총 게시글: <? echo board_count('B1'); ?>
임시게시판 2 총 게시글: <? echo board_count('B2'); ?>
-----------------------------------------------------------
답변이 달렸네요 이런식으로하니 잘 되네요.
<?php echo board_count('B1')?> // php 선언 하는 습관도 좋습니다^^~