테스트 사이트 - 개발 중인 베타 버전입니다

게시판별 순위 알수있을까요? 채택완료

welcome 8년 전 조회 4,417

 

</div><div class="line alt1" style="font-family: Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; font-size: 14.004px; color: rgb(80, 80, 80); margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background: none rgb(255, 255, 255) !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.8em !important;"><div class="line alt1" style="font-size: 14.004px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.8em !important;"><?</div><div class="line alt1" style="font-size: 14.004px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.8em !important;">$sql = sql_query("select * from {$g5['board_table']}"); //db의 모든 게시판을 찾는다.</div><div class="line alt1" style="font-size: 14.004px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.8em !important;">while($data = sql_fetch_array($sql)){</div><div class="line alt1" style="font-size: 14.004px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.8em !important;"><span class="Apple-tab-span" style="white-space:pre">	</span>$row = sql_fetch("SELECT COUNT(*) AS cnt FROM g5_write_{$data[bo_table]}"); </div><div class="line alt1" style="font-size: 14.004px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.8em !important;">//게시판 하나씩 해당 게시판의 글갯수를 구한다.</div><div class="line alt1" style="font-size: 14.004px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.8em !important;"><span class="Apple-tab-span" style="white-space:pre">	</span>$board_total += $row['cnt']; //총갯수가 나올때마다 $board_total에 더한다.</div><div class="line alt1" style="font-size: 14.004px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.8em !important;"><span class="Apple-tab-span" style="white-space:pre">	</span></div><div class="line alt1" style="font-size: 14.004px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.8em !important;"><span class="Apple-tab-span" style="white-space:pre">	</span>echo "bbs명 :".$data[bo_table]." - 갯수 :".$row['cnt']."
";</div><div class="line alt1" style="font-size: 14.004px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.8em !important;">}</div><div class="line alt1" style="font-size: 14.004px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.8em !important;">echo $board_total; //총게시판의 게시글갯수 출력</div><div class="line alt1" style="font-size: 14.004px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.8em !important;">echo "
";</div><div class="line alt1" style="font-size: 14.004px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.8em !important;">?></div><div class="line alt1" style="font-size: 14.004px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.8em !important;">

각 게시판 별 활동(댓글+글수) 카운트를 하는것 까진 구현이 된상태입니다.
혹시 순위로 만들수있을까요?
위 소스를 이용해 활동 포인트가 높은 순으로 나열하고 싶습니다.
1위 - freeboard
2위 - picture
3위 - introduce
... 이런식으로요...

선배님들 도와주세요...감사합니다.
댓글을 작성하려면 로그인이 필요합니다.

답변 2개

채택된 답변
+20 포인트

</p><p>$query = sql_query("SELECT bo_table, bo_subject, bo_count_write + bo_count_comment AS cnt FROM g5_board ORDER BY bo_count_write + bo_count_comment DESC");</p><p>while($rows = sql_fetch_array($query)) {</p><p>    echo $rows['bo_table'].$rows['bo_subject']."
"; </p><p>}</p><p>
 

그냥 g5_board 테이블 읽는 게 더 낫지 않을까요? 

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

답변에 대한 댓글 1개

만두야닷컴
8년 전
정답!!!

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

플라이
8년 전

제가 보기에도 bo_table에 원하시는 정보가 있기에 bo_table 테이블 기준으로 처리하셔도 될듯 보입니다.

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

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

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

로그인