Jump to content

Highscores system, first at top [database]


beennn

Recommended Posts

I've set up highscores for a game i'm working on, though im faced with an issue when two people get the same score. I want the player who achieved the score first to be at the top of the leader boards. Does anyone have any suggestions on how I can achieve this? Any help or pointers would be great, and sorry if this isn't the correct place to be asking.

Edited by beennn
  • Like 1
Link to comment
Share on other sites

As Ingolme alluded to, you would want to save the time that user set the high score. The most flexible way to save dates is as a timestamp.http://php.net/manual/en/datetime.gettimestamp.php From this point onward, you can ORDER BY in the query against the name of the column that you saved the timestamp in, or ORDER BY the high score, and if you have a tie, the user with the "smaller" timestamp would be listed first.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...