Simple ranking page ODBC with pages

Results 1 to 11 of 11
  1. #1
    Status: Pooping eele is offline
    MemberRank
    Jul 2008 Join Date
    The NetherlandsLocation
    915Posts

    thumbs up Simple ranking page ODBC with pages

    Here is a little release from me.

    You can easily change the amount of characters you want to show per page or what it selects in total.

    Screenshot
    http://easy-upload.nl/f/PMcqORUJ


    config.php

    Spoiler:

    PHP Code:
    <?php
    #Ranking Page for RageZone by Eele

    //ODBC connection vars
    $db "GunzDB"// Database name
    $user "sa"// Username for the database
    $pw "123456"// Password for the database

    // Max per page
    $max 20// Shows X per page
    $top 1000// Shows top X ranking
    // The amount of pages you'll get by $top / $max

    ?>


    index.php
    Spoiler:
    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Ranking Page For RageZone by Eele</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <style type="text/css">
    body{
    background:#000;
    font-family:"Calibri", Arial, Verdana;
    font-size:13px;
    color:#fff;
    }
    table, td, th
    {
    background:#000;
    border:1px solid green;
    padding:2px;
    }

    .rank{
    background:#000;
    border:1px solid green;
    padding:2px;
    text-decoration: none;
    margin: 2px;
    color:#fff;
    }

    .rank:hover{
    border:4px solid green;
    background: green;
    }
    .ranka{
    background:#000;
    color:#fff;
    padding:2px;
    text-decoration: none;
    margin: 2px;
    border:4px solid green;
    background: green;
    }
    </style>
    </head>
    <body> 
    <?php
    #Ranking Page for RageZone by Eele

    // Include the config file :)
    include("config.php");

    // Connection
    $con odbc_connect($db,$user,$pw);

    // Aantal chars
    $count odbc_exec($con,"SELECT * From Character WHERE DeleteFlag='0'");
    $lol odbc_num_rows($count);

    //Anti SQL injection function

    function sanitize($sql)
    {
        return (
    htmlentities(str_replace("'""''"$sql)));
    }

    //pages

    $page sanitize($_GET['p']);
    $selectmax $page*$max-$max;
    $array = @range($page*$max-$max+1,$lol,1);

    if(!
    $page OR $page <= OR $page round($top $max)){
    $page 1;
    $selectmax 0;
    $array range(1,$lol,1);
    }

    //query
    $statement "SELECT TOP $max * FROM Character where CID not in (select top $selectmax CID from Character order by XP DESC) AND DeleteFlag='0' order by XP DESC";
    $query odbc_exec($con,$statement);

    echo 
    "<div align='center'>
    <table cellspacing='4'>
    Top 
    $top Ranking
    <tr>
    <td>Ranking</td><td>Lv.</td><td>Name</td><td>Exp</td><td>KillCount</td><td>DeathCount</td><td>PlayTime</td><td>Sex</td>
    </tr>
    "
    ;

    for(
    $i=0$i $max$i++){

    $results odbc_fetch_object($query);

    echo  
    "<tr>
    <td>"
    $array[$i] ."</td>
    <td>"
    .$results -> Level ."</td>
    <td><strong>"
    .$results -> Name ."</strong></td>
    <td>"
    .$results -> XP ."</td>
    <td>"
    .$results -> KillCount ."</td>
    <td>"
    .$results -> DeathCount ."</td>
    <td>"
    .round($results -> PlayTime 3600,2) ." Hour(s)</td>";

    if(
    $results -> Sex == 1){
    echo 
    "<td>Woman</td>";
    }elseif(
    $results -> Sex == 0){
    echo 
    "<td>Man</td>";
    }
    echo 
    "</tr>";
    }

    echo 
    "
    </table><hr />"
    ;

    for(
    $x 1$x round($top $max) + 1$x++){
    if(
    $page==$x){
    echo 
    "<a class='ranka' href='?p=".$x."'>".$x."</a>";
    }else{
    echo 
    "<a class='rank' href='?p=".$x."'>".$x."</a>";
    }
    }
    echo 
    "</div>";

    ?>

    Or download the 2 files:)
    Download link(.rar)


  2. #2
    Account Upgraded | Title Enabled! llMafiall is offline
    MemberRank
    Dec 2009 Join Date
    SumwhereeLocation
    610Posts

    Re: Simple ranking page ODBC with pages

    Woaw top 1000 lolz

  3. #3
    Member Kanoru is offline
    MemberRank
    Dec 2009 Join Date
    RageZone Rock !Location
    74Posts

    Re: Simple ranking page ODBC with pages

    thanks :)
    i need a ranking with pages, but not have browser of pj :(
    EDIT= not DNS on config ? :S
    Last edited by Kanoru; 12-06-10 at 02:13 AM.

  4. #4
    Status: Pooping eele is offline
    MemberRank
    Jul 2008 Join Date
    The NetherlandsLocation
    915Posts

    Re: Simple ranking page ODBC with pages

    Quote Originally Posted by Kanoru View Post
    thanks :)
    i need a ranking with pages, but not have browser of pj :(
    EDIT= not DNS on config ? :S
    What ever you like to call it:P

  5. #5
    Software Engineer Evil[]Power is offline
    MemberRank
    Apr 2010 Join Date
    Look behind...Location
    1,191Posts

    Re: Simple ranking page ODBC with pages

    WOOT Thanks

  6. #6
    Account Upgraded | Title Enabled! wesley1189 is offline
    MemberRank
    Dec 2009 Join Date
    On a potatoLocation
    407Posts

    Re: Simple ranking page ODBC with pages

    Doesn't work for me...

    Code:
    Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application, SQL state IM014 in SQLConnect in C:\wamp\www\Rankings\index.php on line 52
    
    Warning: odbc_exec() expects parameter 1 to be resource, boolean given in C:\wamp\www\Rankings\index.php on line 55
    
    Warning: odbc_num_rows() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 56
    
    Warning: odbc_exec() expects parameter 1 to be resource, boolean given in C:\wamp\www\Rankings\index.php on line 79
    Top 50 Ranking
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 2 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 3 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 4 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 5 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 6 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 7 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 8 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 9 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 10 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 11 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 12 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 13 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 14 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 15 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 16 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 17 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 18 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 19 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104

  7. #7
    Account Upgraded | Title Enabled! 00niels00 is offline
    MemberRank
    Sep 2008 Join Date
    The NetherlandsLocation
    1,041Posts

    Re: Simple ranking page ODBC with pages

    Quote Originally Posted by wesley1189 View Post
    Doesn't work for me...

    Code:
    Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application, SQL state IM014 in SQLConnect in C:\wamp\www\Rankings\index.php on line 52
    
    Warning: odbc_exec() expects parameter 1 to be resource, boolean given in C:\wamp\www\Rankings\index.php on line 55
    
    Warning: odbc_num_rows() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 56
    
    Warning: odbc_exec() expects parameter 1 to be resource, boolean given in C:\wamp\www\Rankings\index.php on line 79
    Top 50 Ranking
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 2 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 3 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 4 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 5 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 6 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 7 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 8 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 9 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 10 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 11 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 12 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 13 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 14 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 15 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 16 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 17 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 18 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    
    Warning: odbc_fetch_object() expects parameter 1 to be resource, null given in C:\wamp\www\Rankings\index.php on line 91
    
    Notice: Undefined offset: 19 in C:\wamp\www\Rankings\index.php on line 94
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 95
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 96
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 97
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 98
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 99
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 100
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 102
    
    Notice: Trying to get property of non-object in C:\wamp\www\Rankings\index.php on line 104
    Lol are you serious? That only happens when you enterend wrong connect details.
    Open index.php and search for
    "$con"
    Change it to your ODBC password, and set the ODBC to GunzDB
    Last edited by 00niels00; 13-06-10 at 11:32 AM.

  8. #8
    Account Upgraded | Title Enabled! gabire is offline
    MemberRank
    Dec 2008 Join Date
    CanadaLocation
    577Posts

    Re: Simple ranking page ODBC with pages

    Thanks u Bro 9/10

  9. #9
    I am Dylan. I<3Bass is offline
    MemberRank
    Jun 2010 Join Date
    New YorkLocation
    953Posts

    Re: Simple ranking page ODBC with pages

    Thanks Dude. Very Nice Ranking Page Release.

  10. #10
    Account Upgraded | Title Enabled! wesley1189 is offline
    MemberRank
    Dec 2009 Join Date
    On a potatoLocation
    407Posts

    Re: Simple ranking page ODBC with pages

    I don't think i have entered something wrong though.

    Code:
       <?php
    #Ranking Page for RageZone by Eele
    
    //ODBC connection vars
    $db = "GunzDB"; // Database name
    $user = "sa"; // Username for the database
    $pw = "Mypassword"; // Password for the database
    
    // Max per page
    $max = 10; // Shows X per page
    $top = 30; // Shows top X ranking
    // The amount of pages you'll get by $top / $max
    
    ?>
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Ranking Page For RageZone by Eele</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <style type="text/css">
    body{
    background:#000;
    font-family:"Calibri", Arial, Verdana;
    font-size:13px;
    color:#fff;
    }
    table, td, th
    {
    background:#000;
    border:1px solid green;
    padding:2px;
    }
    
    .rank{
    background:#000;
    border:1px solid green;
    padding:2px;
    text-decoration: none;
    margin: 2px;
    color:#fff;
    }
    
    .rank:hover{
    border:4px solid green;
    background: green;
    }
    .ranka{
    background:#000;
    color:#fff;
    padding:2px;
    text-decoration: none;
    margin: 2px;
    border:4px solid green;
    background: green;
    }
    </style>
    </head>
    <body> 
    <?php
    #Ranking Page for RageZone by Eele
    
    // Include the config file :)
    include("config.php");
    
    // Connection
    $con = odbc_connect($db,$user,$pw);
    
    // Aantal chars
    $count = odbc_exec($con,"SELECT * From Character WHERE DeleteFlag='0'");
    $lol = odbc_num_rows($count);
    
    //Anti SQL injection function
    
    function sanitize($sql)
    {
        return (htmlentities(str_replace("'", "''", $sql)));
    }
    
    //pages
    
    $page = sanitize($_GET['p']);
    $selectmax = $page*$max-$max;
    $array = @range($page*$max-$max+1,$lol,1);
    
    if(!$page OR $page <= 1 OR $page > round($top / $max)){
    $page = 1;
    $selectmax = 0;
    $array = range(1,$lol,1);
    }
    
    //query
    $statement = "SELECT TOP $max * FROM Character where CID not in (select top $selectmax CID from Character order by XP DESC) AND DeleteFlag='0' order by XP DESC";
    $query = odbc_exec($con,$statement);
    
    echo "<div align='center'>
    <table cellspacing='4'>
    Top $top Ranking
    <tr>
    <td>Ranking</td><td>Lv.</td><td>Name</td><td>Exp</td><td>KillCount</td><td>DeathCount</td><td>PlayTime</td><td>Sex</td>
    </tr>
    ";
    
    for($i=0; $i < $max; $i++){
    
    $results = odbc_fetch_object($query);
    
    echo  "<tr>
    <td>". $array[$i] ."</td>
    <td>".$results -> Level ."</td>
    <td><strong>".$results -> Name ."</strong></td>
    <td>".$results -> XP ."</td>
    <td>".$results -> KillCount ."</td>
    <td>".$results -> DeathCount ."</td>
    <td>".round($results -> PlayTime / 3600,2) ." Hour(s)</td>";
    
    if($results -> Sex == 1){
    echo "<td>Woman</td>";
    }elseif($results -> Sex == 0){
    echo "<td>Man</td>";
    }
    echo "</tr>";
    }
    
    echo "
    </table><hr />";
    
    for($x = 1; $x < round($top / $max) + 1; $x++){
    if($page==$x){
    echo "<a class='ranka' href='?p=".$x."'>".$x."</a>";
    }else{
    echo "<a class='rank' href='?p=".$x."'>".$x."</a>";
    }
    }
    echo "</div>";
    
    ?>
    Last edited by wesley1189; 13-06-10 at 10:50 PM.

  11. #11
    Status: Pooping eele is offline
    MemberRank
    Jul 2008 Join Date
    The NetherlandsLocation
    915Posts

    Re: Simple ranking page ODBC with pages

    Quote Originally Posted by wesley1189 View Post
    I don't think i have entered something wrong though.

    Code:
       <?php
    #Ranking Page for RageZone by Eele
    
    //ODBC connection vars
    $db = "GunzDB"; // Database name
    $user = "sa"; // Username for the database
    $pw = "Mypassword"; // Password for the database
    
    // Max per page
    $max = 10; // Shows X per page
    $top = 30; // Shows top X ranking
    // The amount of pages you'll get by $top / $max
    
    ?>
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Ranking Page For RageZone by Eele</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <style type="text/css">
    body{
    background:#000;
    font-family:"Calibri", Arial, Verdana;
    font-size:13px;
    color:#fff;
    }
    table, td, th
    {
    background:#000;
    border:1px solid green;
    padding:2px;
    }
    
    .rank{
    background:#000;
    border:1px solid green;
    padding:2px;
    text-decoration: none;
    margin: 2px;
    color:#fff;
    }
    
    .rank:hover{
    border:4px solid green;
    background: green;
    }
    .ranka{
    background:#000;
    color:#fff;
    padding:2px;
    text-decoration: none;
    margin: 2px;
    border:4px solid green;
    background: green;
    }
    </style>
    </head>
    <body> 
    <?php
    #Ranking Page for RageZone by Eele
    
    // Include the config file :)
    include("config.php");
    
    // Connection
    $con = odbc_connect($db,$user,$pw);
    
    // Aantal chars
    $count = odbc_exec($con,"SELECT * From Character WHERE DeleteFlag='0'");
    $lol = odbc_num_rows($count);
    
    //Anti SQL injection function
    
    function sanitize($sql)
    {
        return (htmlentities(str_replace("'", "''", $sql)));
    }
    
    //pages
    
    $page = sanitize($_GET['p']);
    $selectmax = $page*$max-$max;
    $array = @range($page*$max-$max+1,$lol,1);
    
    if(!$page OR $page <= 1 OR $page > round($top / $max)){
    $page = 1;
    $selectmax = 0;
    $array = range(1,$lol,1);
    }
    
    //query
    $statement = "SELECT TOP $max * FROM Character where CID not in (select top $selectmax CID from Character order by XP DESC) AND DeleteFlag='0' order by XP DESC";
    $query = odbc_exec($con,$statement);
    
    echo "<div align='center'>
    <table cellspacing='4'>
    Top $top Ranking
    <tr>
    <td>Ranking</td><td>Lv.</td><td>Name</td><td>Exp</td><td>KillCount</td><td>DeathCount</td><td>PlayTime</td><td>Sex</td>
    </tr>
    ";
    
    for($i=0; $i < $max; $i++){
    
    $results = odbc_fetch_object($query);
    
    echo  "<tr>
    <td>". $array[$i] ."</td>
    <td>".$results -> Level ."</td>
    <td><strong>".$results -> Name ."</strong></td>
    <td>".$results -> XP ."</td>
    <td>".$results -> KillCount ."</td>
    <td>".$results -> DeathCount ."</td>
    <td>".round($results -> PlayTime / 3600,2) ." Hour(s)</td>";
    
    if($results -> Sex == 1){
    echo "<td>Woman</td>";
    }elseif($results -> Sex == 0){
    echo "<td>Man</td>";
    }
    echo "</tr>";
    }
    
    echo "
    </table><hr />";
    
    for($x = 1; $x < round($top / $max) + 1; $x++){
    if($page==$x){
    echo "<a class='ranka' href='?p=".$x."'>".$x."</a>";
    }else{
    echo "<a class='rank' href='?p=".$x."'>".$x."</a>";
    }
    }
    echo "</div>";
    
    ?>
    Add me on Msn -> on my profile:)

    I'll help you with Teamviewer;)



Advertisement