I'm using the bukkit API for minecraft and I'm curious how I would be able to retrieve the first, second, third etc; highest value depending on what a user enters in a command part.
Ignore the commandpart. I'm just wondering how I would return the first, second and third highest values etc; from MySQL.
What would I put in the SQL statement in order to do so?
Update: This is what I got so far http://pastebin.com/698AJmq6
My structure is:
How would I return the name with the highest winstreak?
You're not retrieving from PhpMyAdmin. PhpMyAdmin is only a page that shows you the SQL databases. You do not need PhpMyAdmin at all to read values from an SQL server, you're getting the values from the SQL server itself.
As for the question, in that pastebin you have the following code:
ResultSet Winstreak = p.ec.sql.querySQL("SELECT * FROM `profiles`
ORDER BY `Winstreak` DESC LIMIT '" + e.getLine(3) + "';" );
To get the name of player with the n'th highest winstreak:
Winstreak.absolute(n); // Move cursor to a specific row
String name = Winstreak.getString("Name");