-
[RELEASE]Web Ranking Page with sortable collums.
Hi every one i made this simple ranking page awail ago.
It has sortable collums.
Like sort by EXP, DeathCount, KillCount, Name and Rank
How to use it:- Make an new php file.
- Copy past this copy in to it
- Insert the right thing for the odbc connection.
Work for Jan and July 2007 Database.
Code:
<?
#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", "game", "test");
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>';
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("<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>'; }
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("<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>'; }
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("<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>'; }
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("<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>'; }
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("<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>'; }
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("<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>'; }
?>
Have fun and feel free to edit or use it.
-
Re: [RELEASE]Web Ranking Page with sortable collums.
w00t f1rst p0st ? n1ce r3l3/]s3 r0t/]n/] g0/l//l//] try it n0w
[mod]
English Please[/mod]
-
Re: [RELEASE]Web Ranking Page with sortable collums.
Nice Release Rotana.
Was Looking For One.
Thanks.
Preview Of It.
http://register.no-ip.biz/ranking.php
-
Re: [RELEASE]Web Ranking Page with sortable collums.
Freakn What I Needed Ty So Much Rotana
-
Re: [RELEASE]Web Ranking Page with sortable collums.
I've a little question, when i put this code on my php server, he return :
[CODE]Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][Gestionnaire de pilotes ODBC] Source de donn
-
Re: [RELEASE]Web Ranking Page with sortable collums.
Well One Thing.
Post The Error In English.
-
Re: [RELEASE]Web Ranking Page with sortable collums.
try this:
Code:
<?
#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", "your_login_user", "your_password");
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>';
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("<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>'; }
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("<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>'; }
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("<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>'; }
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("<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>'; }
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("<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>'; }
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("<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>'; }
?>
and in line 5 :
Quote:
$connect = odbc_connect("GunzDB", "your_login_user", "your_password");
write what its on your mssql
-
Re: [RELEASE]Web Ranking Page with sortable collums.
Okay to begin ill try to translate my error message :
Code:
Warning: odbc_connect () [function.odbc-connect]: SQL error: [Microsoft] [ODBC Manager] Data source not found and name of drivers (pilots ?) unspecified, SQL state IM002 in SQLConnect in C: \ wamp \ www \ gunzweb \ reg.php on line 5
And this message appear too when i write
PHP Code:
$connect = odbc_connect("GunzDB", "sa", "mypwd");
-
Re: [RELEASE]Web Ranking Page with sortable collums.
Go Too The Odb Donnection Thing.
Click System Tab.
And Register It On That Also.
With Same Info.
Should Work.
-
Re: [RELEASE]Web Ranking Page with sortable collums.
ah :D
Thank you very much Squares :)
Thx a lot again =)
-
Re: [RELEASE]Web Ranking Page with sortable collums.
-
Re: [RELEASE]Web Ranking Page with sortable collums.
-
Re: [RELEASE]Web Ranking Page with sortable collums.
nice one square never saw this post be4 :P anyways how come that every lvl 99 started GM's are the highest ranks? xD unfair :P im next to unfair GM's xD anyways Rotana nice rank page! :D
-
Re: [RELEASE]Web Ranking Page with sortable collums.
Thank you. Ill put it in good use ^^
-
Re: [RELEASE]Web Ranking Page with sortable collums.
Thanks dude, i'll test it out :D
-
Re: [RELEASE]Web Ranking Page with sortable collums.
-
Re: [RELEASE]Web Ranking Page with sortable collums.
Thanks alot again Rotana!!
-
Re: [RELEASE]Web Ranking Page with sortable collums.
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.
-
Re: [RELEASE]Web Ranking Page with sortable collums.
This page can be edited really easy. You ad an limit to the querys if you want.
-
Re: [RELEASE]Web Ranking Page with sortable collums.
You know that, i know that, a PHP-er knows that, but most of the owners dont.
-
Re: [RELEASE]Web Ranking Page with sortable collums.
I will make an update for it the next couple of days.
-
Re: [RELEASE]Web Ranking Page with sortable collums.
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 have some problems with WAMP extensions wich are disable and may need which to put on so this problem goes away?
I suppose it echo and if else problem extension ?
-
Re: [RELEASE]Web Ranking Page with sortable collums.
Press some enters and put it as PHP code.
-
Re: [RELEASE]Web Ranking Page with sortable collums.
is the odbc with mssql?
PHP 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>';
?>
just passing by.. tell me if it works for ya
-
Re: [RELEASE]Web Ranking Page with sortable collums.
This is code is for odbc connection, it should work with out any problems.
-
Re: [RELEASE]Web Ranking Page with sortable collums.
Quote:
Originally Posted by
Rotana
I will make an update for it the next couple of days.
I dont see any updates -__-, all i see is Rotana being like that guy who was falsely releasing GunZ source -.-