[Help] Devil Square ranking

128ve980

Active Member
Joined
Dec 11, 2008
Messages
236
Reaction score
99
Моля за помощ някой който разбира от пхп... Имам проблем поиграх си малко с тази класация и сега ми работи, но ...Класа на героите не го показва правилно...Според нея всички са Соул Мастъри..

PHP:
<?php
require 'config.php';
$msconnect=mssql_connect("$dbhost","$dbuser","$dbpasswd");
$msdb=mssql_select_db("ranking",$msconnect);
$query = "select CharacterName,Class,point from EVENT_INFO  order by point desc";
$result = mssql_query( $query );
echo '<table class=ms border="0" width="480" cellpadding="0" cellspacing="1" align="center">
<tr>
	<td class=mem width=17><center><b>#</center></b></td>
	<td class=mem><center><font size=2><b>Character</center></b></td>
	<td class=mem><center><font size=2><b>Class</center></b></td>
	<td class=mem><center><font size=2><b>Score</center></b></td>';
for($i=0;$i < mssql_num_rows($result);++$i)
{
$row = mssql_fetch_row($result);
$rank = $i + 1;

if ($row[1] == 0) { $class = "Dark Wizard"; }
if ($row[1] == 1) { $class = "Soul Master"; }
if ($row[1] == 2) { $class = "Grand Master"; }
if ($row[1] == 16) { $class = "Dark Knight"; }
if ($row[1] == 17) { $class = "Blade Knight"; }
if ($row[1] == 18) { $class = "Blade Master"; }
if ($row[1] == 32) { $class = "Elf"; }
if ($row[1] == 33) { $class = "Muse Elf"; }
if ($row[1] == 34) { $class = "High Elf"; }
if ($row[1] == 48) { $class = "Magic Gladiator"; }
if ($row[1] == 50) { $class = "Duel Master"; }
if ($row[1] == 64) { $class = "Dark Lord"; }
if ($row[1] == 66) { $class = "Lord Emperor"; }

echo"
<tr>
		<td class=mem align='center'>$rank</td>
		<td class=mem align='center'>$row[0]</td>
		<td class=mem align='center'>$class</td>
		<td class=mem align='center'>$row[2]</td>
		</tr>
";
}
?></table>

моля поправате ми грешките ако можете... Благодаря предварително..
 
Опитай с това:
PHP:
<?php
require 'config.php';
$msconnect=mssql_connect("$dbhost","$dbuser","$dbpasswd");
$msdb=mssql_select_db("ranking",$msconnect);
$query = "select CharacterName,Class,point from EVENT_INFO  order by point desc";
$result = mssql_query( $query );
echo '<table class=ms border="0" width="480" cellpadding="0" cellspacing="1" align="center">
<tr>
    <td class=mem width=17><center><b>#</center></b></td>
    <td class=mem><center><font size=2><b>Character</center></b></td>
    <td class=mem><center><font size=2><b>Class</center></b></td>
    <td class=mem><center><font size=2><b>Score</center></b></td>';
for($i=0;$i < mssql_num_rows($result);++$i)
{
$row = mssql_fetch_row($result);
$rank = $i + 1;

$class = mssql_fetch_row(mssql_query("Use MuOnline; Select Class From Character Where Name='".$row[0]."'"));

if ($class[0] == 0) { $class = "Dark Wizard"; }
elseif ($class[0] == 1) { $class = "Soul Master"; }
elseif ($class[0] == 2) { $class = "Grand Master"; }
elseif ($class[0] == 16) { $class = "Dark Knight"; }
elseif ($class[0] == 17) { $class = "Blade Knight"; }
elseif ($class[0] == 18) { $class = "Blade Master"; }
elseif ($class[0] == 32) { $class = "Elf"; }
elseif ($class[0] == 33) { $class = "Muse Elf"; }
elseif ($class[0] == 34) { $class = "High Elf"; }
elseif ($class[0] == 48) { $class = "Magic Gladiator"; }
elseif ($class[0] == 50) { $class = "Duel Master"; }
elseif ($class[0] == 64) { $class = "Dark Lord"; }
elseif ($class[0] == 66) { $class = "Lord Emperor"; }

echo"
<tr>
        <td class=mem align='center'>$rank</td>
        <td class=mem align='center'>$row[0]</td>
        <td class=mem align='center'>$class</td>
        <td class=mem align='center'>$row[2]</td>
        </tr>
";
}
?></table>
 
Браво :) Добра работа колега :)
 
изпревариме не бях в форума :D
 
feature21 ащо не ни кажеш как си го подкарал (think) (angel) и да ни дадеш нужните файлове ако може