묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
순위가 이상하게 나와요;
2004.01.18 01:45
http://ham965.nazzang.cc/rung/game1/rank.php제가 웹알피지를 만들고있거든요.. 근데 레벨 순위를 뽑을려고 저렇게 했는데.. 레벨이 1, 4, 8, 12, 30 이렇게 있다면 순위가 8, 4, 30, 12, 1 이런식으로 맨 앞숫자의 크기 순으로 나와요.. 이거 어떻게 해야되죠?;
<?
include "db_config.php";
$que = "SELECT name, r_level, r_hp, r_dhp, r_exp, r_weapon, r_am FROM $member_table where r_level >= '1' order by r_level DESC";
@mysql_list_fields($que);
$result = mysql_query($que);
if(!$result) {
$errorNo = mysql_errno();
$errorMsg = mysql_error();
echo "에러 코드 " . $errNo . " : " . $errMSG;
exit;
}
$fields = mysql_num_fields($result);
echo("<table border=0 width=600>n");
echo("<tr>");
echo("<td width=100 bgcolor=pink height=30 align=center>이름</td>n");
echo("<td width=50 bgcolor=pink height=30 align=center>레벨</td>n");
echo("<td width=50 bgcolor=pink height=30 align=center>남은 체력</td>n");
echo("<td width=50 bgcolor=pink height=30 align=center>기본 체력</td>n");
echo("<td width=150 bgcolor=pink height=30 align=center>경험치</td>n");
echo("<td width=100 bgcolor=pink height=30 align=center>무기</td>n");
echo("<td width=100 bgcolor=pink height=30 align=center>방어구</td>n");
while($row = mysql_fetch_row($result)) {
echo("<tr>n");
for($i = 0; $i < $fields; $i++) {
echo("<td bgcolor=lightyellow height=30 align=center>$row[$i]</td>n");
}
echo("</tr>n");
}
echo("</table>");
mysql_close($connect);
?>
<?
include "db_config.php";
$que = "SELECT name, r_level, r_hp, r_dhp, r_exp, r_weapon, r_am FROM $member_table where r_level >= '1' order by r_level DESC";
@mysql_list_fields($que);
$result = mysql_query($que);
if(!$result) {
$errorNo = mysql_errno();
$errorMsg = mysql_error();
echo "에러 코드 " . $errNo . " : " . $errMSG;
exit;
}
$fields = mysql_num_fields($result);
echo("<table border=0 width=600>n");
echo("<tr>");
echo("<td width=100 bgcolor=pink height=30 align=center>이름</td>n");
echo("<td width=50 bgcolor=pink height=30 align=center>레벨</td>n");
echo("<td width=50 bgcolor=pink height=30 align=center>남은 체력</td>n");
echo("<td width=50 bgcolor=pink height=30 align=center>기본 체력</td>n");
echo("<td width=150 bgcolor=pink height=30 align=center>경험치</td>n");
echo("<td width=100 bgcolor=pink height=30 align=center>무기</td>n");
echo("<td width=100 bgcolor=pink height=30 align=center>방어구</td>n");
while($row = mysql_fetch_row($result)) {
echo("<tr>n");
for($i = 0; $i < $fields; $i++) {
echo("<td bgcolor=lightyellow height=30 align=center>$row[$i]</td>n");
}
echo("</tr>n");
}
echo("</table>");
mysql_close($connect);
?>
하면 됩니다.