맘에 안드는 게시판...
본문
맘에 안드는 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문은 쓸때마다 아리송하네요