PDA

View Full Version : mysql problem


davidbull
05/03/2015, 01:15 PM
how to get player mysql id from name (GetPlayerName)?
I will rep+
thanks

MikE1990
05/03/2015, 01:18 PM
Change field name and table name :)
SELECT `FIELD NAME` FROM `TABLE NAME` WHERE `Username` = '%s'

davidbull
05/03/2015, 01:22 PM
can i get player rank from top 10 list? sorry for my bad english ^.^

MikE1990
05/03/2015, 01:29 PM
of course you can.Change table name and if your field is not rank change it too.
SELECT `Rank` FROM `TABLE NAME` ORDER BY Rank LIMIT 10

davidbull
05/03/2015, 03:22 PM
no, i mean get the player position on top 10 list.
example:
TOP NAME SCORES
1. abcd1 10
2. abcd2 9
3. abcd3 8
4. abcd4 7
5. abcd5 6
6. abcd6 5
...
to the player position exam is 10 :)). how to do it

Kaliber
05/03/2015, 03:25 PM
SELECT `Username` FROM `TABLE NAME` ORDER BY Rank LIMIT 10

Greekz :cool:

davidbull
05/03/2015, 03:57 PM
SELECT `Username` FROM `TABLE NAME` ORDER BY Rank LIMIT 10

Greekz :cool:

no limit

MikE1990
05/03/2015, 04:13 PM
no, i mean get the player position on top 10 list.
Thats why he use LIMIT 10