How to record top scoreres in the game?

Discussion in 'PHP' started by comcharan, Aug 28, 2008.

  1. #1
    I am making a simple game website using javascript....I want to show the list like top 10 highscores on a webpage..

    If user clicks on submit button after entering,it should check whether he is a top scorer or not.If he is a top scorer then his name should be displayed in top scorers list

    can any 1 please help me to do this?
     
    comcharan, Aug 28, 2008 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    SELECT `username` FROM `score_table_name` ORDER BY `score_field` DESC LIMIT 10
    Code (markup):
    That's the SQL you need to run. then you just loop through the results to see if the users username is in there
     
    JAY6390, Aug 28, 2008 IP
  3. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #3
    ^ Found your way to DP, huh? ;)
     
    nico_swd, Aug 28, 2008 IP
  4. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #4
    lol yes. I saw this forum a year or so ago, just never registered with it. I could join 1000's like you but I have to work every so often ;)
     
    JAY6390, Aug 28, 2008 IP
  5. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #5
    Lol, slow down there! I'm just active on 3 forums (2 of them being programming forums). :D
     
    nico_swd, Aug 28, 2008 IP
  6. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #6
    haha...well I'm a member of a lot more forums than that, although not so active on the majority :rolleyes:
     
    JAY6390, Aug 28, 2008 IP