Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Score Ranking system

Status
Not open for further replies.

WizyWyg

Technical User
Jan 31, 2001
854
JP
Im trying to figure out a script to use to use for a Score Ranking system for a game.

Someone who scores points in a game can post their score to the database and based on that score appear in a table that will display where he/she would be ranked.

I am having problems in displaying the "ranking" table

What i need to have it do is:

Put a Rank (ie 1-10) in one column (say via a listing function)
Put their name in the next column
Their score in the third column
and their comments in the fourth column

Something like this:
[Rank][Name][Score][Comment]
[ 1 ][Eric][98999][yeah! ]
[ 2 ][Sean][77745][almost!]

and so forth. I need to have the Rank # be auto-generated by the php script.

any ideas?

 
If the rank is determined by the scoring (cause its a game ranking) then you dont have to save the rank, because the score is leading.
Therefor i would write it to a table without the ranknumber and when you read the table you can sort players by there score and give them a rank number.

If you want an id number you can use the mysql auto_increment or when you work with postgres; create a sequence.

Is this what you wanted to know? mcvdmvs
-- "It never hurts to help" -- Eek the Cat
 
I just sat down and figured it out, but I want to implement an "anti-cheat" feature (im taking this step by step).

The game has different "stages" set at different difficulties. When they "pass" one of these stages, they are given a "password" along with their score. Each stage/difficulty has its own set of "passwords" assigned to it (about 5, 10 digit numbers)

ex. easy stage 1 has 5 different passwords; easy medium has its own set of passwords... etc

How can I set up the DB so that when someone enters their information into a form (along with the pw and score), itll compare the password to the ones in the DB set for that stage/difficulty and allow them to "go on", or stop them to re-enter the pw correctly.
 
This is easy,


You can have a table with all the PW's you have and the ranking of their.

Afterwards you collect everything in another table all the scores and usernames and difficult ... or what you want.

Go get the table just do an order by on the score and get only the top 10 rows.

Anikin
Hugo Alexandre Dias
Web-Programmer
anikin@ip.pt
 
So, as a person is entering the form with their info (name, pw and score with comment) HOW do i get it to verify the pw so that they can't cheat?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top