답변 1개
채택된 답변
+20 포인트
마르스컴퍼니
Expert
10개월 전
</p>
<p><?php
// 메뉴 갯수 구하기
function get_submenu_count($me_code) {
global $g5;
$length = strlen($me_code); // 상위 메뉴코드 길이
$sql = " select count(*) as cnt
from {$g5['menu_table']}
where me_code like '{$me_code}%'
and length(me_code) = " . ($length + 2);
$row = sql_fetch($sql);
return (int)$row['cnt'];
}</p>
<p>// 게시판 그룹내 게시판 갯수 구하기
function get_group_board_count($gr_id) {
global $g5;
$sql = " select count(*) as cnt
from {$g5['board_table']}
where gr_id = '{$gr_id}' ";
$row = sql_fetch($sql);
return (int)$row['cnt'];
}</p>
<p>// 사용 예
$menu_count = get_submenu_count('10'); // 10으로 시작하는 하위메뉴 갯수
$board_count = get_group_board_count('community'); // community 그룹의 게시판 갯수</p>
<p>
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인