테이블 값순으로 정렬..

포인트순으로 정렬을 어케하는지..


<?php
$sub_menu = "200810";
include_once("./_common.php");

auth_check($auth[$sub_menu], "r");

$token = get_token();

$g4[title] = "현재접속자";
include_once("./admin.head.php");

$select_login_count = "select count(1) as login_count
from g4_login";
$select_login_count_result = sql_fetch($select_login_count);
$select_login_count_result = $select_login_count_result[login_count];

$select_login_list = "select *
from g4_login
order by lo_datetime desc";
$select_login_list_result = sql_query($select_login_list);
$select_login_count = sql_fetch_array($select_login_list_result[login_count]);
?>
<table border="0" width="100%" align="center">
<tr>
<td><strong><font color="black">총접속자 : <?=$select_login_count_result?> 명</font></strong></td>
</tr>
<tr>
<td>
<table border="1" width="80%">
<tr>
<td width="15%" align="center"><strong>아이디</strong></td>
<td width="15%" align="center"><strong>닉네임</strong></td>
<td width="12%" align="center"><strong>포인트</strong></td>
<td width="20%" align="center"><strong>시간</strong></td>
<td width="30%" align="center"><strong>위치</strong></td>
</tr>
<?
for($i=0;$row=sql_fetch_array($select_login_list_result);$i++){
$mb_nick = get_sideview($row[mb_id], $row[mb_nick], $row[mb_email], $row[mb_homepage]);
$mb_info = get_member($row[mb_id]);
?>
<tr>
<td align="center"><strong><font color="black"><?=$row[mb_id]?></font></strong> </td>
<td align="center"><strong><font color="black"><?=$mb_nick?></font></strong> </td>
<td align="right"><font color="red"><?=number_format($mb_info[mb_point])?> <font color="black">원</font> </td>
<td align="center"><strong><font color="black"><?=$row[lo_datetime]?></font></strong> </td>
<td><?=$row[lo_location]?> </td>

</tr>
<?}?>
</table>
</td>
</tr>
</table>

<?
include_once ("./admin.tail.php");
?>
|

댓글 1개

jQuery Plugin sort 를 활용하시던가, MySQL 쿼리를 수정하셔야합니다.

$select_login_list = "select * from g4_login order by lo_datetime desc";
$select_login_list = "SELECT a.*, b.mb_nick, b.mb_email, b.mb_homepage, b.mb_point FROM g4_login AS a LEFT JOIN g4_member AS b ON a.mb_id = b.mb_id WHERE a.mb_id <> '' ORDER BY b.mb_point DESC";

이런식으로 변경하시면 됩니다. 테스트는 안해봤습니다......
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
12년 전 조회 1,550
12년 전 조회 893
12년 전 조회 1,094
12년 전 조회 1,544
12년 전 조회 2,068
12년 전 조회 1,534
12년 전 조회 1,013
12년 전 조회 793
12년 전 조회 1,553
12년 전 조회 962
12년 전 조회 1,593
12년 전 조회 764
12년 전 조회 1,682
12년 전 조회 3,999
12년 전 조회 965
12년 전 조회 1,032
12년 전 조회 1,014
12년 전 조회 1,211
12년 전 조회 1,037
12년 전 조회 1,545
🐛 버그신고