Ranking

Discussion in 'PHP' started by G3n3s!s, Feb 10, 2011.

  1. #1
    Hello. I am creating stats for my game, but I don't know HOW to do it. Please help how can I find my rank? I want to make it optimalized, but I don't know how

    If I select it like this

    SELECT username, id, password FROM users WHERE population >= $mypopulation

    and then count number of results, I get my rank, but I do not know how to get which others ids I have to select
     
    G3n3s!s, Feb 10, 2011 IP
  2. Simple Link Media

    Simple Link Media Peon

    Messages:
    38
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    While it might not be what you are asking for but as a tip - do not try to obtain useless data; what for do you need password value in this case ?
     
    Simple Link Media, Feb 10, 2011 IP
  3. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #3
    in this case, for nothing :D I was sorting it by passwords because I don't have got population system
     
    G3n3s!s, Feb 11, 2011 IP
  4. seoservice1

    seoservice1 Well-Known Member

    Messages:
    1,401
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    130
    #4
    problem is not in details, unable to understand.
     
    seoservice1, Feb 11, 2011 IP
  5. W3Theory

    W3Theory Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I can only assume from what you've said that you're only counting the data from the first result, so it will only return 1 result.
    Are you looping it? That will loop through the results and display all....
     
    W3Theory, Feb 11, 2011 IP
  6. G3n3s!s

    G3n3s!s Active Member

    Messages:
    325
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    80
    #6
    I got it. thanks anyways
     
    G3n3s!s, Feb 11, 2011 IP