포인트 랭킹 순위 구하는 방법 정보
포인트 랭킹 순위 구하는 방법관련링크
첨부파일
본문
사용자데모
http://gnuboard5.untitle311apyxry1w48.com
데모
<?php
//ver1.0 150410 @_untitle_d
?>
<table>
<tr>
<td colspan="3">포인트 순위 Top10</td>
</tr>
<?php
$point_sql = "SELECT DISTINCT t1.mb_id, t1.mb_point, t1.mb_nick, COUNT(t1.mb_id) AS ranking
FROM {$g5['member_table']} t1, {$g5['member_table']} t2
WHERE (t1.mb_point < t2.mb_point
OR t1.mb_id = t2.mb_id)
GROUP BY t1.mb_id
ORDER BY ranking
LIMIT 0 , 10";
$point_que = mysql_query($point_sql);
while($point_row = mysql_fetch_array($point_que)){
$tmp_member = sql_fetch("select mb_id, mb_nick, mb_email, mb_homepage from {$g5['member_table']} where mb_id = '".$point_row['mb_id']."'");
$tmp_sideview = get_sideview($tmp_member['mb_id'], cut_str($tmp_member['mb_nick'], $config['cf_cut_name']), $tmp_member['mb_email'], $tmp_member['mb_homepage']); ?>
<tr>
<td><?=$point_row['ranking']?></td>
<td><?=$tmp_sideview?></td>
<td><?=number_format($point_row['mb_point'])?></td>
</tr>
<? } ?>
</table>
참고
http://blog.naver.com/storm99m/150001859068
http://gnuboard5.untitle311apyxry1w48.com
데모
<?php
//ver1.0 150410 @_untitle_d
?>
<table>
<tr>
<td colspan="3">포인트 순위 Top10</td>
</tr>
<?php
$point_sql = "SELECT DISTINCT t1.mb_id, t1.mb_point, t1.mb_nick, COUNT(t1.mb_id) AS ranking
FROM {$g5['member_table']} t1, {$g5['member_table']} t2
WHERE (t1.mb_point < t2.mb_point
OR t1.mb_id = t2.mb_id)
GROUP BY t1.mb_id
ORDER BY ranking
LIMIT 0 , 10";
$point_que = mysql_query($point_sql);
while($point_row = mysql_fetch_array($point_que)){
$tmp_member = sql_fetch("select mb_id, mb_nick, mb_email, mb_homepage from {$g5['member_table']} where mb_id = '".$point_row['mb_id']."'");
$tmp_sideview = get_sideview($tmp_member['mb_id'], cut_str($tmp_member['mb_nick'], $config['cf_cut_name']), $tmp_member['mb_email'], $tmp_member['mb_homepage']); ?>
<tr>
<td><?=$point_row['ranking']?></td>
<td><?=$tmp_sideview?></td>
<td><?=number_format($point_row['mb_point'])?></td>
</tr>
<? } ?>
</table>
참고
http://blog.naver.com/storm99m/150001859068
추천
3
3
댓글 9개
잘 쓸께요...^^
감사합니다..^^
사랑합니다.
좋은자료 감사
감사
감사함당
좋은 자료네요~~ 감사해요~
감사합니다~
오홋~ 찾던거였어요! 고맙습니다~