MySQL Ranking

Discussion in 'Plugin Development' started by creppii, Nov 11, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    creppii

    sup...
    i'm doing a ranking with mysql... and now i have a problem. how is the query to get the postition/rank from the playername?
    thx for help!

    work now :)

    for all who have the same problem, use this query:
    Code:java
    1. SELECT COUNT(*) FROM table WHERE column >= (SELECT column FROM table WHERE name='" + player +"')


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
  2. Offline

    nlthijs48

    creppii Only if that 'guy with the same problem' has the exact same table and column layout that query will work, so it is not that useful for others.
     
  3. Offline

    creppii

    nlthijs48 i edited my code... but i think they're able to change the code at their own...
     
  4. Offline

    acer5999

    nlthijs48 That was rather insensitive. It is quite useful to others, SQL is so simple to use that anyone with even a simplistic understanding of SQL Querying can look at that string and tell you what it does. That query could be changed to fit someones specific needs. This is a help forum. People come here for help, if someone comes here and sees a question about SQL queries that they think might apply to them and then see that OP just posted, "nvm solvd lel mod plz dlt lel" they would get rather annoyed. So please, think before post.
     
    thomasb454 likes this.
  5. Offline

    nlthijs48

    acer5999 creppii I'm sorry that I replied in a negative and harsh way, I will try to be more constructive and positive next time.

    What I should have said is that it would be useful to know a little bit more about the tables and colums that you used in your query, because that could help other people even more. Thank you for posting the solution to your problem in the first place, some people don't do this after fixing a problem on their own.
     
  6. Offline

    es359

  7. Offline

    FabeGabeMC

    es359 and DevRosemberg like this.
  8. Offline

    DevRosemberg

    FabeGabeMC More people use it than what i though lol. (1 Person) I did one which works with PermissionAttachments and Groups (with nodes) etc but it's private to TimelessMC.
     
    es359 likes this.
  9. Offline

    es359

    Sorry, FabeGabeMC DevRosemberg I was unaware that you had a forum/bukkit account.

    I starred it on github lol. DevRosemberg

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
  10. Offline

    FabeGabeMC

    es359
    I didn't mean it in an imperative way, just saying you should, not have to.
     
    es359 likes this.
Thread Status:
Not open for further replies.

Share This Page