Perfect Ranking Script.!

Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Account Upgraded | Title Enabled! lmanso is offline
    MemberRank
    Jun 2008 Join Date
    ThailandLocation
    241Posts

    Perfect Ranking Script.!

    config.php Page
    PHP Code:
    <?php
    $mssqlcon    
    =    "Your Computer Name\SQLEXPRESS";
    $mssqluser    =    "sa";
    $mssqlpass    =    "Your mssql password";

    $sv_ip    =    "xxx.xxx.xxx.xx";
    ?>

    rank.php Page
    PHP Code:
    <?php
    include "./config.php";
    ?>
    <table width="100%" border="0" cellpadding="1" cellspacing="1">
            <tr>
              <td height="23" colspan="6" background="sub.jpg"><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
                  <tr>
                    <td><center><?php
            $link 
    = @mssql_connect("$mssqlcon""$mssqluser""$mssqlpass") or die ("Server is down!");
            
    $db = @mssql_select_db('ACCOUNT_DBF') or die ("Accout table is missing!");
            
    $b '';
        
    $mail '';
            
    $query mssql_query('SELECT * FROM [ACCOUNT_TBL]');
            echo 
    'Total Accounts: ' mssql_num_rows($query);
    ?></center></td>
                    <td><center><?php
            $link 
    = @mssql_connect("$mssqlcon""$mssqluser""$mssqlpass") or die ("Server is down!");
            
    $db = @mssql_select_db('CHARACTER_01_DBF') or die ("Accout table is missing!");
            
    $b '';
        
    $mail '';
            
    $query mssql_query('SELECT * FROM [CHARACTER_TBL]');
            echo 
    'Total Characters: ' mssql_num_rows($query);
    ?></center></td>
                  </tr>
                </table>
                <div align="center" class="style66">TOP 20 </div></td>
              </tr>
            <tr>
            <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9">
                  <div align="left" class="style72">No.</div>          </td>
              <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9">
                  <div align="left" class="style72">Name</div>          </td>
              <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9"><div align="center" class="style72">Level</div></td>
              <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9"><div align="center" class="style72">Class</div></td>
              <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9"><div align="center" class="style72">Penya</div></td>
              <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9"><div align="center" class="style72">Location</div></td>
            </tr>
     
            <?
            $link 
    mssql_connect("$mssqlcon""$mssqluser""$mssqlpass") ;
            
    $db mssql_select_db("CHARACTER_01_DBF");
    // Job Funtion
    function quetrabajo($job){
    if (
    $job == '0'){
    echo 
    "Vagrant";
    }
    if (
    $job == '1'){
    echo 
    "Mercenary";
    }
    if (
    $job == '2'){
    echo 
    "Acrobat";
    }
    if (
    $job == '3'){
    echo 
    "Assist";
    }
    if (
    $job == '4'){
    echo 
    "Magician";
    }
    if (
    $job == '5'){
    echo 
    "Puppeter";
    }
    if (
    $job == '6'){
    echo 
    "Knight";
    }
    if (
    $job == '7'){
    echo 
    "Blade";
    }
    if (
    $job == '8'){
    echo 
    "Jester";
    }
    if (
    $job == '9'){
    echo 
    "Ranger";
    }
    if (
    $job == '10'){
    echo 
    "Ringmaster";
    }
    if (
    $job == '11'){
    echo 
    "billposter";
    }
    if (
    $job == '12'){
    echo 
    "Psykeeper";
    }
    if (
    $job == '13'){
    echo 
    "Elementor";
    }
    if (
    $job == '14'){
    echo 
    "Gatekeeper";
    }
    if (
    $job == '15'){
    echo 
    "Doppler";
    }
    if (
    $job == '16'){
    echo 
    "M-Knight";
    }
    if (
    $job == '17'){
    echo 
    "M-Blade";
    }
    if (
    $job == '18'){
    echo 
    "M-Jester";
    }
    if (
    $job == '19'){
    echo 
    "M-Ranger";
    }
    if (
    $job == '20'){
    echo 
    "M-Ringmaster";
    }
    if (
    $job == '21'){
    echo 
    "M-Billposter";
    }
    if (
    $job == '22'){
    echo 
    "M-Psykeeper";
    }
    if (
    $job == '23'){
    echo 
    "M-Elementor";
    }
    if (
    $job == '24'){
    echo 
    "H-Knight";
    }
    if (
    $job == '25'){
    echo 
    "H-Blade";
    }
    if (
    $job == '26'){
    echo 
    "H-Jester";
    }
    if (
    $job == '27'){
    echo 
    "H-Ranger";
    }
    if (
    $job == '28'){
    echo 
    "H-Ringmaster";
    }
    if (
    $job == '29'){
    echo 
    "H-Billposter";
    }
    if (
    $job == '30'){
    echo 
    "H-Psykeeper";
    }
    if (
    $job == '31'){
    echo 
    "H-Elementor";
    }
    }

    // Location Funtion
    function location($loca){
    if (
    $loca == '1'){
    echo 
    "Madrigal";
    }
    if (
    $loca == '2'){
    echo 
    "Azria";
    }
    if (
    $loca == '200'){
    echo 
    "Mars Mine Dungeon";
    }
    if (
    $loca == '201'){
    echo 
    "Dekane Mines";
    }
    if (
    $loca == '203'){
    echo 
    "Volcano Entrance";
    }
    if (
    $loca == '202'){
    echo 
    "Guild War Map";
    }
    if (
    $loca == '204'){
    echo 
    "Ivillis Dungeon";
    }
    if (
    $loca == '205'){
    echo 
    "Ivillis Dungeon (Boss)";
    }
    if (
    $loca == '208'){
    echo 
    "Arena";
    }
    if (
    $loca == '21'){
    echo 
    "Forsaken B1";
    }
    if (
    $loca == '22'){
    echo 
    "Forsaken B2";
    }
    if (
    $loca == '23'){
    echo 
    "Forsaken B3";
    }
    if (
    $loca == '24'){
    echo 
    "Forsaken B4";
    }
    if (
    $loca == '25'){
    echo 
    "Forsaken B5";
    }
    if (
    $loca == '121'){
    echo 
    "OMINOUS";
    }
    if (
    $loca == '209'){
    echo 
    "Mini Room";
    }
    if (
    $loca == '3'){
    echo 
    "Coral Island";
    }
    }

    $resTop mssql_query("SELECT TOP 20 P.m_szName, P.m_nLevel, P.m_nJob, P.m_dwGold, P.dwWorldID FROM CHARACTER_01_DBF.dbo.CHARACTER_TBL P ORDER BY P.m_nLevel DESC, P.m_nExp1 DESC ");
    $ctr 1;
    while (
    $row3 mssql_fetch_array($resTop)){
        
    $chNm $row3["m_szName"];
        
    $chLv $row3["m_nLevel"];
        
    $chCls $row3["m_nJob"];
        
    $chSc$row3["m_dwGold"];
        
    $chmap $row3["dwWorldID"];

    ?>
            <tr>
            <td bgcolor="#FFFFFF" class="submit"><span class="style68">
                <?=$ctr++;?>
              </span></td>
              <td bgcolor="#FFFFFF" class="submit"><span class="style68">
                <?=$chNm;?>
              </span></td>
              <td bgcolor="#FFFFFF" class="submit"><div align="center" class="style72"><span class="style1">
                  <?=$chLv;?>
              </span></div></td>
              <td bgcolor="#FFFFFF" class="submit"><div align="center" class="style72"><span class="style1">
                  <?=quetrabajo($chCls);?>
              </span></div></td>
              <td bgcolor="#FFFFFF" class="submit"><div align="center" class="style72"><span class="style1">
                  <?=$chSc;?>
              </span></div></td>
              <td bgcolor="#FFFFFF" class="submit"><div align="center" class="style72"><span class="style1">
                  <?=location($chmap);?>
              </span></div></td>
            </tr>
            <?
    }

    ?>
            <tr>
              <td colspan="6" background="bg_tile.gif" bgcolor="#666666">&nbsp;</td>
              </tr>
            
          </table>
    Last edited by lmanso; 25-01-10 at 05:18 PM.


  2. #2

    Re: Perfect Ranking Script.!

    Nice job :)

    P.S Why did you not put the job displayer in to str_replace? so basicly as you'd know, find numbers and replace to what job, id think that would be easy enough, still good job :)

  3. #3
    Valued Member rtosoftware is offline
    MemberRank
    Jun 2007 Join Date
    128Posts

    Re: Perfect Ranking Script.!

    function quetrabajo and location are useless...

  4. #4
    Account Upgraded | Title Enabled! Imortal is offline
    MemberRank
    Aug 2006 Join Date
    EverywhereLocation
    293Posts

    Re: Perfect Ranking Script.!

    I'm pretty sure there's a stored procedure that does all this for you. all you have to do is execute it, and retrieve the information from the table.
    The table is 'tblCharacterRank' and the sp is 'usp_ranking'
    Note: it selects all Non GM Chars (F) but that's easily fixed

  5. #5
    Pilipinas FLYFF Editor ctby23 is offline
    MemberRank
    Jun 2009 Join Date
    In your orgasm.Location
    244Posts

    Re: Perfect Ranking Script.!

    help me with this error!

    PHP Code:
    Fatal errorAllowed memory size of 8388608 bytes exhausted (tried to allocate 1456 bytesin C:\wamp\www\rank\rank.php on line 21 
    TNX!

  6. #6
    Apprentice PeyMan is offline
    MemberRank
    Nov 2009 Join Date
    24Posts

    Re: Perfect Ranking Script.!

    Bei mir zeigt er keien Spielr

  7. #7
    Valued Member Looky is offline
    MemberRank
    Apr 2009 Join Date
    142Posts

    Re: Perfect Ranking Script.!

    Hi,

    Good release but the list of characters do not appear, why?
    Thanks.

  8. #8
    Account Upgraded | Title Enabled! lmanso is offline
    MemberRank
    Jun 2008 Join Date
    ThailandLocation
    241Posts

    Re: Perfect Ranking Script.!

    Quote Originally Posted by Looky View Post
    Hi,

    Good release but the list of characters do not appear, why?
    Thanks.
    use Appserver last version.

  9. #9
    Valued Member Looky is offline
    MemberRank
    Apr 2009 Join Date
    142Posts

    Re: Perfect Ranking Script.!

    Ok thanks but with easyphp no works?

  10. #10
    Apprentice PeyMan is offline
    MemberRank
    Nov 2009 Join Date
    24Posts

    Re: Perfect Ranking Script.!

    It does not show any character.

  11. #11
    Account Upgraded | Title Enabled! Wokki is offline
    MemberRank
    Aug 2008 Join Date
    FinlandLocation
    724Posts

    Re: Perfect Ranking Script.!

    On the Table TD's theres "background="gradient_thead.gif"
    Thats kind of useless if you don't give the background too.

  12. #12
    Apprentice KevinsComputer is offline
    MemberRank
    Sep 2008 Join Date
    17Posts

    Re: Perfect Ranking Script.!

    Script say:

    Server is down

    Server IS NOT down

  13. #13
    Account Upgraded | Title Enabled! ryuchao009 is offline
    MemberRank
    Feb 2009 Join Date
    United StatesLocation
    601Posts

    Re: Perfect Ranking Script.!

    Quote Originally Posted by KevinsComputer View Post
    Script say:

    Server is down

    Server IS NOT down
    Then your connection details are incorrect

  14. #14
    This is bullshit. alextepes is offline
    MemberRank
    Sep 2006 Join Date
    CanadaLocation
    310Posts

    Re: Perfect Ranking Script.!

    cleaner rank.php

    PHP Code:
    <?php
        
    include "./config.php";
                
    $link = @mssql_connect($mssqlcon$mssqluser$mssqlpass) or die ("Server is down!"); 
        
    //No dual connection is needed because the original connection was never closed!!!!, Which is bad for memory and security.
                
    $db = @mssql_select_db('ACCOUNT_DBF') or die ("Accout table is missing!");
        
    // Job Function - Class and cleaner parsing by alextepes - no reason to parse all ifs if its already been found. Time is of the essence.
        
    class job {
                function 
    jname($job) {

            if (
    $job == 0$jname =  'Vagrant';
                else if (
    $job == 1$jname 'Mercenary';
                else if (
    $job == 2$jname 'Acrobat';
                else if (
    $job == 3$jname 'Assist';
                else if (
    $job == 4$jname 'Magician';
                else if (
    $job == 5$jname 'Puppeter';
                else if (
    $job == 6$jname 'Knight';
                else if (
    $job == 7$jname 'Blade';
                else if (
    $job == 8$jname 'Jester';
                else if (
    $job == 9$jname 'Ranger';
                else if (
    $job == 10$jname 'Ringmaster';
                else if (
    $job == 11$jname 'billposter';
                else if (
    $job == 12$jname 'Psykeeper';
                else if (
    $job == 13$jname 'Elementor';
                else if (
    $job == 14$jname 'Gatekeeper';
                else if (
    $job == 15$jname 'Doppler';
                else if (
    $job == 16$jname 'M-Knight';
                else if (
    $job == 17$jname 'M-Blade';
                else if (
    $job == 18$jname 'M-Jester';
                else if (
    $job == 19$jname 'M-Ranger';
                else if (
    $job == 20$jname 'M-Ringmaster';
                else if (
    $job == 21$jname 'M-Billposter';
                else if (
    $job == 22$jname 'M-Psykeeper';
                else if (
    $job == 23$jname 'M-Elementor';
                else if (
    $job == 24$jname 'H-Knight';
                else if (
    $job == 25$jname 'H-Blade';
                else if (
    $job == 26$jname 'H-Jester';
                else if (
    $job == 27$jname 'H-Ranger';
                else if (
    $job == 28$jname 'H-Ringmaster';
                else if (
    $job == 29$jname 'H-Billposter';
                else if (
    $job == 30$jname 'H-Psykeeper';
                else if (
    $job == 31$jname 'H-Elementor';
                else 
    $jname 'An applicable job name could not be found in our records.';
                return 
    $jname

           }

        
    // Location Function
           
    function location($loca) {

            if (
    $loca == 1$lname 'Madrigal';
            else if (
    $loca == 2$lname 'Azria';
            else if (
    $loca == 200$lname 'Mars Mine Dungeon';
            else if (
    $loca == 201$lname 'Dekane Mines';
            else if (
    $loca == 203$lname 'Volcano Entrance';
            else if (
    $loca == 202$lname 'Guild War Map';
            else if (
    $loca == 204$lname 'Ivillis Dungeon';
            else if (
    $loca == 205$lname 'Ivillis Dungeon (Boss)';
            else if (
    $loca == 208$lname 'Arena';
            else if (
    $loca == 21$lname 'Forsaken B1';
            else if (
    $loca == 22$lname 'Forsaken B2';
            else if (
    $loca == 23$lname 'Forsaken B3';
            else if (
    $loca == 24$lname 'Forsaken B4';
            else if (
    $loca == 25$lname 'Forsaken B5';
            else if (
    $loca == 121$lname 'OMINOUS';
            else if (
    $loca == 209$lname 'Mini Room';
            else if (
    $loca == 3$lname 'Coral Island';
            else 
    $lname 'A location could not be matched.';
            return 
    $lname;
           }
        }
        
    $job = new job;
    ?>
    <table width="100%" border="0" cellpadding="1" cellspacing="1">
            <tr>
              <td height="23" colspan="6" background="sub.jpg"><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
                  <tr>
                    <td><center>
    <?php
               $query 
    mssql_query('SELECT * FROM [ACCOUNT_TBL]');
                echo 
    'Total Accounts: ' mssql_num_rows($query);
    ?>
    </center></td>
                    <td><center>
    <?php
                $db 
    = @mssql_select_db('CHARACTER_01_DBF') or die ("Accout table is missing!");
                        
    $query mssql_query('SELECT * FROM [CHARACTER_TBL]');
                        echo 
    'Total Characters: ' mssql_num_rows($query);
    ?>
    </center></td>
                  </tr>
                </table>
                <div align="center" class="style66">TOP 20 </div></td>
              </tr>
            <tr>
            <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9">
                  <div align="left" class="style72">No.</div>          </td>
              <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9">
                  <div align="left" class="style72">Name</div>          </td>
              <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9"><div align="center" class="style72">Level</div></td>
              <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9"><div align="center" class="style72">Class</div></td>
              <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9"><div align="center" class="style72">Penya</div></td>
              <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9"><div align="center" class="style72">Location</div></td>
            </tr>
     
    <?php
                    $db 
    mssql_select_db("CHARACTER_01_DBF");
            
    $resTop mssql_query("SELECT TOP 20 P.m_szName, P.m_nLevel, P.m_nJob, P.m_dwGold, P.dwWorldID FROM CHARACTER_01_DBF.dbo.CHARACTER_TBL P ORDER BY P.m_nLevel DESC, P.m_nExp1 DESC ");
            
    $ctr 1;
            while (
    $row3 mssql_fetch_array($resTop)) {
                
    $chNm $row3["m_szName"];
                
    $chLv $row3["m_nLevel"];
                
    $chCls $row3["m_nJob"];
                
    $chSc$row3["m_dwGold"];
                
    $chmap $row3["dwWorldID"];
    ?>
            <tr>
            <td bgcolor="#FFFFFF" class="submit"><span class="style68">
                <?php echo $ctr++; ?>
              </span></td>
              <td bgcolor="#FFFFFF" class="submit"><span class="style68">
                <?php echo $chNm?>
              </span></td>
              <td bgcolor="#FFFFFF" class="submit"><div align="center" class="style72"><span class="style1">
                  <?php echo $chLv?>
              </span></div></td>
              <td bgcolor="#FFFFFF" class="submit"><div align="center" class="style72"><span class="style1">
                  <?php echo $job->jname($chCls); ?>
              </span></div></td>
              <td bgcolor="#FFFFFF" class="submit"><div align="center" class="style72"><span class="style1">
                  <?php echo $chSc?>
              </span></div></td>
              <td bgcolor="#FFFFFF" class="submit"><div align="center" class="style72"><span class="style1">
                  <?php echo $job->location($chmap); ?>
              </span></div></td>
            </tr>
    <?php
    }
    mssql_close($link);
    ?>
            <tr>
              <td colspan="6" background="bg_tile.gif" bgcolor="#666666">&nbsp;</td>
              </tr>
            
          </table>
    Notes to OP(lmanso)

    Nothing is ever perfect!

    Dual connection is NOT needed because the original connection was never closed!!!!, Which is bad for memory and security.

    USE else if, don't make the script check all the if's, if an integer was already found, that's bad for ram.

    It'd be good practice not to echo from a function.

    CLOSE YOUR MYSQL OR MSSQL CONNECTIONS WHEN DONE, A skilled hacker, or script kiddy can easily listen on the packets from an open mssql connection, keeping it open like that is asking for trouble.
    And use ONE not TWO if you're using the same server.

    USE <?php not <? or <?= (Especially not this if you think that is a cool way to do echo's.)

  15. #15
    Account Upgraded | Title Enabled! ecKo9321 is offline
    MemberRank
    Nov 2009 Join Date
    forum.ragezoneLocation
    491Posts

    Re: Perfect Ranking Script.!

    Quote Originally Posted by alextepes View Post
    cleaner rank.php

    PHP Code:
    <?php
        
    include "./config.php";
                
    $link = @mssql_connect($mssqlcon$mssqluser$mssqlpass) or die ("Server is down!"); 
        
    //No dual connection is needed because the original connection was never closed!!!!, Which is bad for memory and security.
                
    $db = @mssql_select_db('ACCOUNT_DBF') or die ("Accout table is missing!");
        
    // Job Function - Class and cleaner parsing by alextepes - no reason to parse all ifs if its already been found. Time is of the essence.
        
    class job {
                function 
    jname($job) {

            if (
    $job == 0$jname =  'Vagrant';
                else if (
    $job == 1$jname 'Mercenary';
                else if (
    $job == 2$jname 'Acrobat';
                else if (
    $job == 3$jname 'Assist';
                else if (
    $job == 4$jname 'Magician';
                else if (
    $job == 5$jname 'Puppeter';
                else if (
    $job == 6$jname 'Knight';
                else if (
    $job == 7$jname 'Blade';
                else if (
    $job == 8$jname 'Jester';
                else if (
    $job == 9$jname 'Ranger';
                else if (
    $job == 10$jname 'Ringmaster';
                else if (
    $job == 11$jname 'billposter';
                else if (
    $job == 12$jname 'Psykeeper';
                else if (
    $job == 13$jname 'Elementor';
                else if (
    $job == 14$jname 'Gatekeeper';
                else if (
    $job == 15$jname 'Doppler';
                else if (
    $job == 16$jname 'M-Knight';
                else if (
    $job == 17$jname 'M-Blade';
                else if (
    $job == 18$jname 'M-Jester';
                else if (
    $job == 19$jname 'M-Ranger';
                else if (
    $job == 20$jname 'M-Ringmaster';
                else if (
    $job == 21$jname 'M-Billposter';
                else if (
    $job == 22$jname 'M-Psykeeper';
                else if (
    $job == 23$jname 'M-Elementor';
                else if (
    $job == 24$jname 'H-Knight';
                else if (
    $job == 25$jname 'H-Blade';
                else if (
    $job == 26$jname 'H-Jester';
                else if (
    $job == 27$jname 'H-Ranger';
                else if (
    $job == 28$jname 'H-Ringmaster';
                else if (
    $job == 29$jname 'H-Billposter';
                else if (
    $job == 30$jname 'H-Psykeeper';
                else if (
    $job == 31$jname 'H-Elementor';
                else 
    $jname 'An applicable job name could not be found in our records.';
                return 
    $jname

           }

        
    // Location Function
           
    function location($loca) {

            if (
    $loca == 1$lname 'Madrigal';
            else if (
    $loca == 2$lname 'Azria';
            else if (
    $loca == 200$lname 'Mars Mine Dungeon';
            else if (
    $loca == 201$lname 'Dekane Mines';
            else if (
    $loca == 203$lname 'Volcano Entrance';
            else if (
    $loca == 202$lname 'Guild War Map';
            else if (
    $loca == 204$lname 'Ivillis Dungeon';
            else if (
    $loca == 205$lname 'Ivillis Dungeon (Boss)';
            else if (
    $loca == 208$lname 'Arena';
            else if (
    $loca == 21$lname 'Forsaken B1';
            else if (
    $loca == 22$lname 'Forsaken B2';
            else if (
    $loca == 23$lname 'Forsaken B3';
            else if (
    $loca == 24$lname 'Forsaken B4';
            else if (
    $loca == 25$lname 'Forsaken B5';
            else if (
    $loca == 121$lname 'OMINOUS';
            else if (
    $loca == 209$lname 'Mini Room';
            else if (
    $loca == 3$lname 'Coral Island';
            else 
    $lname 'A location could not be matched.';
            return 
    $lname;
           }
        }
        
    $job = new job;
    ?>
    <table width="100%" border="0" cellpadding="1" cellspacing="1">
            <tr>
              <td height="23" colspan="6" background="sub.jpg"><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
                  <tr>
                    <td><center>
    <?php
               $query 
    mssql_query('SELECT * FROM [ACCOUNT_TBL]');
                echo 
    'Total Accounts: ' mssql_num_rows($query);
    ?>
    </center></td>
                    <td><center>
    <?php
                $db 
    = @mssql_select_db('CHARACTER_01_DBF') or die ("Accout table is missing!");
                        
    $query mssql_query('SELECT * FROM [CHARACTER_TBL]');
                        echo 
    'Total Characters: ' mssql_num_rows($query);
    ?>
    </center></td>
                  </tr>
                </table>
                <div align="center" class="style66">TOP 20 </div></td>
              </tr>
            <tr>
            <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9">
                  <div align="left" class="style72">No.</div>          </td>
              <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9">
                  <div align="left" class="style72">Name</div>          </td>
              <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9"><div align="center" class="style72">Level</div></td>
              <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9"><div align="center" class="style72">Class</div></td>
              <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9"><div align="center" class="style72">Penya</div></td>
              <td height="23" background="gradient_thead.gif" bgcolor="#00CC00" class="style9"><div align="center" class="style72">Location</div></td>
            </tr>
     
    <?php
                    $db 
    mssql_select_db("CHARACTER_01_DBF");
            
    $resTop mssql_query("SELECT TOP 20 P.m_szName, P.m_nLevel, P.m_nJob, P.m_dwGold, P.dwWorldID FROM CHARACTER_01_DBF.dbo.CHARACTER_TBL P ORDER BY P.m_nLevel DESC, P.m_nExp1 DESC ");
            
    $ctr 1;
            while (
    $row3 mssql_fetch_array($resTop)) {
                
    $chNm $row3["m_szName"];
                
    $chLv $row3["m_nLevel"];
                
    $chCls $row3["m_nJob"];
                
    $chSc$row3["m_dwGold"];
                
    $chmap $row3["dwWorldID"];
    ?>
            <tr>
            <td bgcolor="#FFFFFF" class="submit"><span class="style68">
                <?php echo $ctr++; ?>
              </span></td>
              <td bgcolor="#FFFFFF" class="submit"><span class="style68">
                <?php echo $chNm?>
              </span></td>
              <td bgcolor="#FFFFFF" class="submit"><div align="center" class="style72"><span class="style1">
                  <?php echo $chLv?>
              </span></div></td>
              <td bgcolor="#FFFFFF" class="submit"><div align="center" class="style72"><span class="style1">
                  <?php echo $job->jname($chCls); ?>
              </span></div></td>
              <td bgcolor="#FFFFFF" class="submit"><div align="center" class="style72"><span class="style1">
                  <?php echo $chSc?>
              </span></div></td>
              <td bgcolor="#FFFFFF" class="submit"><div align="center" class="style72"><span class="style1">
                  <?php echo $job->location($chmap); ?>
              </span></div></td>
            </tr>
    <?php
    }
    mssql_close($link);
    ?>
            <tr>
              <td colspan="6" background="bg_tile.gif" bgcolor="#666666">&nbsp;</td>
              </tr>
            
          </table>
    Notes to OP(lmanso)

    Nothing is ever perfect!

    Dual connection is NOT needed because the original connection was never closed!!!!, Which is bad for memory and security.

    USE else if, don't make the script check all the if's, if an integer was already found, that's bad for ram.

    It'd be good practice not to echo from a function.

    CLOSE YOUR MYSQL OR MSSQL CONNECTIONS WHEN DONE, A skilled hacker, or script kiddy can easily listen on the packets from an open mssql connection, keeping it open like that is asking for trouble.
    And use ONE not TWO if you're using the same server.

    USE <?php not <? or <?= (Especially not this if you think that is a cool way to do echo's.)
    So this is working huh ?



Page 1 of 2 12 LastLast

Advertisement