특정그룹을 제외하고, 지난달 게시글,코멘트,로그인 순위5위 표시하기! 정보
특정그룹을 제외하고, 지난달 게시글,코멘트,로그인 순위5위 표시하기!본문
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=10588
위 파아란기쁨님의 게시글,코멘트,로그인 랭킹 소스를 쓰고 있습니다.
위 게시판에서 특정 그룹을 제외하고, 순위를 적용하고 싶습니다.
아래와 같이 onlymilk74 님이 특정 그룹'만' 추출하여 순위 적용하는 방법을 알려주셨는데,
//글쓰기 랭킹
$sql_common = " from $g4[board_new_table] a, $g4[member_table] b "; //where mb_level < 10 ";
$sql_common = $sql_common . " where a.bn_datetime like '" . $lastmonth . "%' ";
$sql_common = $sql_common . " and a.mb_id <> ''";
$sql_common = $sql_common . " and a.wr_id = a.wr_parent ";
$sql_common = $sql_common . " and a.mb_id = b.mb_id ";
$sql_common = $sql_common . " and b.mb_level < 10 ";
$sql_order = " order by cnt desc ";
부분을 아래와 같이 변경하시면 될듯 합니다
$sql_common = " from $g4[board_new_table] a, $g4[member_table] b , $g4['board_table'] c "; //where mb_level < 10 "; 추가
$sql_common = $sql_common . " where a.bn_datetime like '" . $lastmonth . "%' ";
$sql_common = $sql_common . " and a.mb_id <> ''";
$sql_common = $sql_common . " and a.wr_id = a.wr_parent ";
$sql_common = $sql_common . " and a.mb_id = b.mb_id ";
$sql_common = $sql_common . " and b.mb_level < 10 ";
$sql_common = $sql_common . " AND a.bo_table = c.bo_table "; //추가
$sql_common = $sql_common . " AND c.gr_id = '원하시는그룹아이디'"; //추가
$sql_order = " order by cnt desc ";
여기서 특정 그룹을 '제외'하고 추출할 수는 없을까요?
이리저리 해봤는데 안먹히네요.
위 파아란기쁨님의 게시글,코멘트,로그인 랭킹 소스를 쓰고 있습니다.
위 게시판에서 특정 그룹을 제외하고, 순위를 적용하고 싶습니다.
아래와 같이 onlymilk74 님이 특정 그룹'만' 추출하여 순위 적용하는 방법을 알려주셨는데,
//글쓰기 랭킹
$sql_common = " from $g4[board_new_table] a, $g4[member_table] b "; //where mb_level < 10 ";
$sql_common = $sql_common . " where a.bn_datetime like '" . $lastmonth . "%' ";
$sql_common = $sql_common . " and a.mb_id <> ''";
$sql_common = $sql_common . " and a.wr_id = a.wr_parent ";
$sql_common = $sql_common . " and a.mb_id = b.mb_id ";
$sql_common = $sql_common . " and b.mb_level < 10 ";
$sql_order = " order by cnt desc ";
부분을 아래와 같이 변경하시면 될듯 합니다
$sql_common = " from $g4[board_new_table] a, $g4[member_table] b , $g4['board_table'] c "; //where mb_level < 10 "; 추가
$sql_common = $sql_common . " where a.bn_datetime like '" . $lastmonth . "%' ";
$sql_common = $sql_common . " and a.mb_id <> ''";
$sql_common = $sql_common . " and a.wr_id = a.wr_parent ";
$sql_common = $sql_common . " and a.mb_id = b.mb_id ";
$sql_common = $sql_common . " and b.mb_level < 10 ";
$sql_common = $sql_common . " AND a.bo_table = c.bo_table "; //추가
$sql_common = $sql_common . " AND c.gr_id = '원하시는그룹아이디'"; //추가
$sql_order = " order by cnt desc ";
여기서 특정 그룹을 '제외'하고 추출할 수는 없을까요?
이리저리 해봤는데 안먹히네요.
( select a.* , ( select sum(co_count) as co_count from g4_qa_choose where mb_id=a.mb_id and bo_table = 'g4_qa' ) as q_co_count from `g4_write_g4_qa` a where wr_parent = '280993' and wr_8 != '' and wr_is_comment = 1 and CONVERT(wr_7, UNSIGNED) >= 5 group by wr_content having max(wr_7) order by CONVERT(wr_7, UNSIGNED) desc limit 3 )
1055 : Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'sir.a.wr_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
error file : /15sir/bbs/board.php