[Help] Rena Ranking

Authix

New Member
Joined
Dec 6, 2016
Messages
22
Reaction score
0
Hello guys i try to do renas ranking on 97d+99 but i have a problem, Golden archer working good etc but my ranking working for a alphabetic u i give the screen not a who have more Stones/renas.

cA9PUCv.jpg


And this is the link for my script can someone change that i really bad in scripts .

Link- rena.php - Google Диск
 
Change
$query = "SELECT * FROM T_BLOOD_CASTLE";

To

$query = "SELECT * FROM T_BLOOD_CASTLE ORDER BY StoneCount DESC";
 
I have posted the first post via my phone and was not clear enough and this must be more useful.


Your code:
PHP:
<?php
$hostname = "VPS350363";
$username = "AdminMU";
$password = "1602950024tomeks";
$dbName = "MuOnline";



// SQL Connection set CHECK

MSSQL_CONNECT($hostname,$username,$password) or DIE("DATABASE FAILED TO RESPOND.");
mssql_select_db($dbName) or DIE("Table unavailable");



// Display the data by query

$query = "SELECT * FROM T_BLOOD_CASTLE";

$result = mssql_query( $query );



// Some Desing

echo '<table>';
echo '<tr><td bgcolor=#ffffff><center><font face=Arial size=2><b>Rank</td><td bgcolor=#ffffff><font face=Arial size=2><b>Character</b></font></td><td bgcolor=#ffffff><font face=Arial size=2><b>Stones</b></font></td>';
for($i=0;$i < 10;++$i){
$top = mssql_fetch_row($result);
echo '<tr><td bgcolor=#ffffff width=40><font face=Arial size=2>';
echo $i + 1;
echo '.</font></td><td bgcolor=#ffffff width=110><FONT SIZE=2 face=Arial font color=blue><b>';
echo $top[0];
echo '</b></font></td><td bgcolor=#ffffff width=30><font face=Arial size=2 font color=gray>';
echo $top[1];
echo'</font></td></tr>';}
echo '</tr></table>';


echo '</table>';
echo '</body>';
echo '</html>';

echo '';



//Make sure to close out the database connection

mssql_close(); 

?>
rena.php
Open with
Displaying rena.php.




My suggestion:

PHP:
<?php
$hostname = "VPS350363";
$username = "AdminMU";
$password = "1602950024tomeks";
$dbName = "MuOnline";

MSSQL_CONNECT($hostname,$username,$password) or DIE("DATABASE FAILED TO RESPOND.");
mssql_select_db($dbName) or DIE("Table unavailable");

// How many rows to be displayed
$rows = 10;

$query = mssql_query("SELECT TOP ".$rows." * FROM T_BLOOD_CASTLE order by stones desc"); // IT could be stone not stones into your table check the right name

echo '<table>
           <tr>
		      <td bgcolor=#ffffff><center><font face=Arial size=2><b>Rank</td>
			  <td bgcolor=#ffffff><font face=Arial size=2><b>Character</b></font></td>
			  <td bgcolor=#ffffff><font face=Arial size=2><b>Stones</b></font></td>
           </tr>';
        for($numbers=0;$numbers < mssql_num_rows($query);$numbers++)
		{
		$results = mssql_fetch_row($query);
        echo '
		   <tr>
		      <td bgcolor=#ffffff width=40><font face=Arial size=2>'.$numbers.'</font></td>
		      <td bgcolor=#ffffff width=110><FONT SIZE=2 face=Arial font color=blue><b>'.$results[0].'</b></font></td>
		      <td bgcolor=#ffffff width=30><FONT SIZE=2 face=Arial font color=blue><b>'.$results[1].'</b></font></td>
		   </tr>';
		} 
echo '</table>
		</body>
			</html>';
mssql_close(); 

?>
 
Last edited: