특정 게시판 최근게시물에서 제외 시키기. 채택완료

 

 

 

 

index.php 파일에서 최근게시물 추출하는 소스에서 특정 게시판들을 제외시키고 뽑아내고 싶습니다.

 

http://sir.co.kr/qa/?wr_id=998&stx=%ED%8A%B9%EC%A0%95+%EA%B2%8C%EC%8B%9C%ED%8C%90+%EC%A0%9C%EC%99%B8&sst=wr_num&unanswered=0&s_tag=%EA%B7%B8%EB%88%84%EB%B3%B4%EB%93%9C5

 

여기 답변대로해보았는데, 오류가 나네요 ㅠㅠ; 

도움 요청드립니다.

 

Copy
<!-- 최신글 시작 { --><?php//  최신글$sql = " select bo_table            from `{$g5['board_table']}` a left join `{$g5['group_table']}` b on (a.gr_id=b.gr_id)            where a.bo_device <> 'mobile' ";if(!$is_admin)    $sql .= " and a.bo_use_cert = '' ";$sql .= " order by b.gr_order, a.bo_order ";$result = sql_query($sql);for ($i=0; $row=sql_fetch_array($result); $i++) {    if ($i%2==1) $lt_style = "margin-left:20px";    else $lt_style = "";?>    <div style="float:left;<?php echo $lt_style ?>">        <?php        // 이 함수가 바로 최신글을 추출하는 역할을 합니다.        // 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);        echo latest("basic", $row['bo_table'], 5, 25);        ?>    </div><?php}?><!-- } 최신글 끝 -->

답변 1개

채택된 답변
+20 포인트

링크 경로에 답이 있는데.. 질문자 소스를 그대로 쓰셨네요

Copy
$sql = " select bo_table            from `{$g5['board_table']}` a left join `{$g5['group_table']}` b on (a.gr_id=b.gr_id)            where a.bo_device <> 'mobile' ​and a.bo_table not in ('board1', 'board2')";

 

다른 쿼리는 보지 않았습니다. not in(제외될 게시판명) 적어주면 되요. 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

감사합니당 ㅠㅠ !

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고