Wow thanks
Printable View
Wow thanks
Thanks alot again Rotana!!
Don't forget it got no limit so it can bring the serverload up to 100% for a few seconds if you got about 5000+ Characters.
This page can be edited really easy. You ad an limit to the querys if you want.
You know that, i know that, a PHP-er knows that, but most of the owners dont.
I will make an update for it the next couple of days.
I have some problems with WAMP extensions wich are disable and may need which to put on so this problem goes away?Code:'; if($_GET['s'] == "" or $_GET['s'] == "rank") { $query = "SELECT Name, Level, XP, DeathCount, KillCount FROM Character ORDER BY XP DESC"; $num = '0'; $result = odbc_exec($connect, $query); while(odbc_fetch_row($result)){ $num = $num + 1; $test1 = odbc_result($result, 1); $test2 = odbc_result($result, 2); $test3 = odbc_result($result, 3); $test4 = odbc_result($result, 4); $test5 = odbc_result($result, 5); echo(""); } odbc_close($connect); echo' Rank Name Level Exp Death Count Kill Count $num$test1$test2$test3$test4$test5'; } else if($_GET['s'] == "Level") { $query = "SELECT Name, Level, XP, DeathCount, KillCount FROM Character ORDER BY Level DESC"; $num = '0'; $result = odbc_exec($connect, $query); while(odbc_fetch_row($result)){ $num = $num + 1; $test1 = odbc_result($result, 1); $test2 = odbc_result($result, 2); $test3 = odbc_result($result, 3); $test4 = odbc_result($result, 4); $test5 = odbc_result($result, 5); echo("$num$test1$test2$test3$test4$test5"); } odbc_close($connect); echo' '; } else if($_GET['s'] == "XP") { $query = "SELECT Name, Level, XP, DeathCount, KillCount FROM Character ORDER BY XP DESC"; $num = '0'; $result = odbc_exec($connect, $query); while(odbc_fetch_row($result)){ $num = $num + 1; $test1 = odbc_result($result, 1); $test2 = odbc_result($result, 2); $test3 = odbc_result($result, 3); $test4 = odbc_result($result, 4); $test5 = odbc_result($result, 5); echo("$num$test1$test2$test3$test4$test5"); } odbc_close($connect); echo' '; } else if($_GET['s'] == "DeathCount") { $query = "SELECT Name, Level, XP, DeathCount, KillCount FROM Character ORDER BY DeathCount DESC"; $num = '0'; $result = odbc_exec($connect, $query); while(odbc_fetch_row($result)){ $num = $num + 1; $test1 = odbc_result($result, 1); $test2 = odbc_result($result, 2); $test3 = odbc_result($result, 3); $test4 = odbc_result($result, 4); $test5 = odbc_result($result, 5); echo("$num$test1$test2$test3$test4$test5"); } odbc_close($connect); echo' '; } else if($_GET['s'] == "KillCount") { $query = "SELECT Name, Level, XP, DeathCount, KillCount FROM Character ORDER BY KillCount DESC"; $num = '0'; $result = odbc_exec($connect, $query); while(odbc_fetch_row($result)){ $num = $num + 1; $test1 = odbc_result($result, 1); $test2 = odbc_result($result, 2); $test3 = odbc_result($result, 3); $test4 = odbc_result($result, 4); $test5 = odbc_result($result, 5); echo("$num$test1$test2$test3$test4$test5"); } odbc_close($connect); echo' '; } else if($_GET['s'] == "Name") { $query = "SELECT Name, Level, XP, DeathCount, KillCount FROM Character ORDER BY Name ASC"; $num = '0'; $result = odbc_exec($connect, $query); while(odbc_fetch_row($result)){ $num = $num + 1; $test1 = odbc_result($result, 1); $test2 = odbc_result($result, 2); $test3 = odbc_result($result, 3); $test4 = odbc_result($result, 4); $test5 = odbc_result($result, 5); echo("$num$test1$test2$test3$test4$test5"); } odbc_close($connect); echo' '; } ?>
I suppose it echo and if else problem extension ?
Press some enters and put it as PHP code.
is the odbc with mssql?
just passing by.. tell me if it works for yaPHP Code:<?PHP
#CONFIG STUFF HERE
$_top = 10; //number of people in ranking
$_odbc_name = "GunzDB";
$_odbc_user = "username here";
$_odbc_pass = "password here";
#END OF CONFIG STUFF
#Don't edit anything below if u a noob ...
#This Page is made by Rotana for the Ragezone Community.
#Feel free to edit this page if you want.
#Credits to Rotana.
$connect = odbc_connect("GunzDB", $_odbc_user, $_odbc_pass);
echo'<div align="center"><table width="500" border="1" cellspacing="1" cellpadding="1">
<tr>
<th scope="col"><a href="?s=Rank">Rank</a></th>
<th scope="col"><a href="?s=Name">Name</a></th>
<th scope="col"><a href="?s=Level">Level</a></th>
<th scope="col"><a href="?s=XP">Exp</a></th>
<th scope="col"><a href="?s=DeathCount">Death Count</a></th>
<th scope="col"><a href="?s=KillCount">Kill Count</a></th>
</tr>
<tr>';
switch(@$_GET['s']) {
case '':
case 'Rank':
$query = "SELECT top ".$_top." Name, Level, XP, DeathCount, KillCount FROM Character ORDER BY XP DESC";
break;
case 'Level':
$query = "SELECT top ".$_top." Name, Level, XP, DeathCount, KillCount FROM Character ORDER BY Level DESC";
break;
case 'XP':
$query = "SELECT top ".$_top." Name, Level, XP, DeathCount, KillCount FROM Character ORDER BY XP DESC";
break;
case 'DeathCount':
$query = "SELECT top ".$_top." Name, Level, XP, DeathCount, KillCount FROM Character ORDER BY DeathCount DESC";
break;
case 'KillCount':
$query = "SELECT top ".$_top." Name, Level, XP, DeathCount, KillCount FROM Character ORDER BY KillCount DESC";
break;
case 'Name':
$query = "SELECT top ".$_top." Name, Level, XP, DeathCount, KillCount FROM Character ORDER BY Name ASC";
break;
}
$num = '0';
$result = odbc_exec($connect, $query);
while(odbc_fetch_row($result)){
$num = $num + 1;
$test1 = odbc_result($result, 1);
$test2 = odbc_result($result, 2);
$test3 = odbc_result($result, 3);
$test4 = odbc_result($result, 4);
$test5 = odbc_result($result, 5);
echo("<tr><td>$num</td><td>$test1</td><td>$test2</td><td>$test3</td><td>$test4</td><td>$test5</td></tr>");
}
odbc_close($connect);
echo'</table></div>';
?>
This is code is for odbc connection, it should work with out any problems.