[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