맘에 안드는 게시판...

맘에 안드는 게시판...

QA

맘에 안드는 게시판...

답변 3

본문

맘에 안드는 aaa 게시판을 제외시키켰는데..추가로 bbb게시판도 맘에 안들어 제외시키려는데...

앙되네요,,,무엇이 잘못된걸까요? 즐거운 한가위되세요~

 

if($is_member && $member['mb_level'] > 5 && ($bo_table != "aaa" || $bo_table != "bbb")) { 

 

              $new_count = 10; 

          

              $cnt = 0; 

$sql = " select bo_table, wr_parent from $g5[board_new_table] a where mb_id = '$member[mb_id]' and ( a.bo_table <> 'aaa'  OR a.bo_table <> 'bbb')  and a.wr_id = a.wr_parent group by bo_table, wr_parent order by bn_id desc limit $new_count ";

 

              $res = sql_query($sql);  

이 질문에 댓글 쓰기 :

답변 3

$g5['board_new_table'] 테이블에서 'aaa'와 'bbb'게시판을 제외하고 데이타를 뽑아오는 것이라면 아래와 같이 해보세요.


if($is_member && $member['mb_level'] > 5){
    $sql = " select bo_table, wr_parent from {$g5['board_new_table']} where mb_id = '{$member['mb_id']}' and bo_table not in('aaa','bbb') order by bn_id desc ";
    $res = sql_query($sql);
 
    //데이타 출력예시
    for ($i=0; $row=sql_fetch_array($res); $i++) {
        echo $row['bo_table'].' : '.$row['wr_parent'].'<br>';
    }
}
 

if($is_member && $member['mb_level'] > 5 && ($bo_table != "aaa" || $bo_table != "bbb")) { 

위 부분을

if(($is_member && $member['mb_level']) > 5 && ($bo_table != "aaa" || $bo_table != "bbb")) {

로 먼저 수정해 보세요. 

$bo_table != "aaa" 여기가 $bo_table != "bbb")  ||가아니고 && 아닌가요?
if문은 쓸때마다 아리송하네요 

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