Another question with MySQL: Get rank based XP
Well, let's suppose we have a table like this:
SteamID-----------XP With around 5000 rows. I want to get the rank of certain SteamID, I know how to do the "top", where with just a ORDER BY I can get it. But not get the rank number of someone. The diference is that, with just an ORDER BY I can get who are the ten players who have the highest XP, but if I want to know the rank of certain player, I cant. Keep in mind that I think to show this in a HUD, so It shouldn't burn the CPU. I don't ask for queriyng every second, but maybe every round. |
Re: Another question with MySQL: Get rank by XP
SELECT XP FROM your_table WHERE SteamID="His ID here";
|
Re: Another question with MySQL: Get rank by XP
Quote:
|
Re: Another question with MySQL: Get rank by XP
Quote:
|
Re: Another question with MySQL: Get rank by XP
lol, it seems he doesn't know about SQL.
|
Re: Another question with MySQL: Get rank by XP
Quote:
|
Re: Another question with MySQL: Get rank by XP
-_-"
|
Re: Another question with MySQL: Get rank by XP
Quote:
Quote:
Quote:
In simple words, retrieve the rank of something based on certain value. Quote:
|
Re: Another question with MySQL: Get rank based XP
Sorry for doublepost, but it was needed.
I will explain a bit more what I want. Lets suppose the table is like this --ID---Score 65-5000 86-4000 106-10000 56-2000 As you can se, I have a normal table where I can get the score of someone in a really simple way. Now, lets say player 65 connects, I want to tell you "You are second in the rank", whose rank would be based on the score of each player in the DB |
Re: Another question with MySQL: Get rank based XP
Quote:
|
| All times are GMT -4. The time now is 22:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.