Warning: Undefined array key "mobile_dir" in /home/kagla/new-sir/old/common.php on line 315
특정 기간 동안 댓글 갯수 많은 글들을 뽑고 싶은데 도와주세요.

특정 기간 동안 댓글 갯수 많은 글들을 뽑고 싶은데 도와주세요.

특정 기간 동안 댓글 갯수 많은 글들을 뽑고 싶은데 도와주세요.

QA

특정 기간 동안 댓글 갯수 많은 글들을 뽑고 싶은데 도와주세요.

답변 1

본문


<?php
include "_common.php";
//define('_INDEX_', true);
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
$board_sql = 'select bo_table from '. $g5['board_table'];
$board_query = sql_query($board_sql);
$board_column = 'wr_subject, wr_hit, wr_comment, wr_is_comment';
$tabAll_limit = 10; //최대순위
//각 게시판 테이블명 뽑아내기
while( $board_fetch = sql_fetch_array($board_query) ) {
$bo_table = $board_fetch['bo_table'];
if(!$tabAllBoard['query']) {
$tabAllBoard['query'] = '(select '. $board_column .' from g5_write_'. $bo_table .')';
} else {
$tabAllBoard['query'] .= ' union all (select '. $board_column .' from g5_write_'. $bo_table .')';
}
}
$tabAllQuery = 'select '. $board_column .' from ('. $tabAllBoard['query'] .') where wr_is_comment = 0 order by wr_comment DESC limit '. $tabAll_limit;
$tabAllResult = sql_query($tabAllQuery);
$i=1;
while( $tabAll = sql_fetch_array($tabAllResult) ) {
?>
<li class="h_icon0<?=$i++?>"><a href="<?=$g5['bbs_path']?>/board.php?bo_table="><?=$tabAll['wr_subject']?></a><?=$tabAll['wr_hit']?></li>
<?php
}
?>

 

위 코드를 이용해서 만들려고 하는데... 전체 게시물이 아닌 특정 게시판에서 뽑고 싶고, 기간을 적용하고 싶습니다.

 

예를 들면 2020-01-01, 2020-01-31 이런식으로 넣으면 1월달 데이터를 뽑을 수 있게 하고 싶습니다.

이 질문에 댓글 쓰기 :

답변 1

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 129,406
© SIRSOFT
현재 페이지 제일 처음으로