How to???

Results 1 to 9 of 9
  1. #1
    Account Upgraded | Title Enabled! X-Weaver is offline
    MemberRank
    Jan 2009 Join Date
    XDLocation
    443Posts

    How to???

    hey how to continue tables in ranking xD
    like Ranking 1 to 25 and in second page 26 to 50 how to make that?


  2. #2
    Valued Member Pauliinho is offline
    MemberRank
    Apr 2009 Join Date
    140Posts

    Re: How to???

    hmm
    the ranking thing will search for places 26-50 then ... you know the rest.

  3. #3
    Valued Member ZeroCold is offline
    MemberRank
    Mar 2009 Join Date
    Somewhere I belong.Location
    146Posts

    Re: How to???

    SELECT * FROM Character WHERE Name != '' AND CharNum >= 0 ORDER BY XP desc LIMIT 5, 5

    Like that.

    This will show records 6, 7, 8, 9, and 10

  4. #4
    DRGunZ 2 Creator wesman2232 is offline
    MemberRank
    Jan 2007 Join Date
    Erie, PALocation
    4,872Posts

    Re: How to???

    Quote Originally Posted by ZeroCold View Post
    SELECT * FROM Character WHERE Name != '' AND CharNum >= 0 ORDER BY XP desc LIMIT 5, 5

    Like that.

    This will show records 6, 7, 8, 9, and 10
    I thought MSSQL couldn't use the LIMIT thing?

  5. #5
    Account Upgraded | Title Enabled! Guy is offline
    MemberRank
    Apr 2009 Join Date
    919Posts

    Re: How to???

    Quote Originally Posted by wesman2232 View Post
    I thought MSSQL couldn't use the LIMIT thing?
    It can't; however, it can use the TOP keyword:

    http://www.databasejournal.com/featu...erver-2005.htm

  6. #6
    DRGunZ 2 Creator wesman2232 is offline
    MemberRank
    Jan 2007 Join Date
    Erie, PALocation
    4,872Posts

    Re: How to???

    ya that would be it.
    SELECT TOP 10 from Character ORDER BY EXP and so forth :P

  7. #7
    Account Upgraded | Title Enabled! alfredao is offline
    MemberRank
    Jan 2008 Join Date
    Coronel FabriciLocation
    705Posts

    Re: How to???

    You Need to create a column on char table where shows the ranking of character.

    Page 1 - SELECT TOP 25 FROM Character WHERE Ranking => 1 AND Ranking <= 25 ORDER BY XP
    Page 2 - SELECT TOP 25 FROM Character WHERE Ranking > 26 AND Ranking <= 50 ORDER BY XP
    Page 3 - SELECT TOP 25 FROM Character WHERE Ranking > 51 AND Ranking <= 75 ORDER BY XP

  8. #8
    Apprentice DreamVolume is offline
    MemberRank
    May 2009 Join Date
    At my Desk.Location
    5Posts

    Re: How to???

    Google -> PHP Pagination with Mssql very helpfull :)

  9. #9
    Account Upgraded | Title Enabled! X-Weaver is offline
    MemberRank
    Jan 2009 Join Date
    XDLocation
    443Posts

    Re: How to???

    o.o thanks xD im making the ranking page xD thanks very much all guys here hehe



Advertisement