Useful MySQL Habbo Queries

Page 1 of 2 12 LastLast
Results 1 to 25 of 38
  1. #1
    TheJacob was here. TheJacob is offline
    MemberRank
    Jun 2010 Join Date
    Toronto, CanadaLocation
    326Posts

    Useful MySQL Habbo Queries

    Useful MySQL Habbo Queries

    Below are some basic Update, Insert and Delete queries that are commonly, and uncommonly used, yet very important. If you have queries, or want to request a query. Post a reply below with a query you need and/or want and either myself or someone else from the community will generate a query for you.

    When using any of the queries below, anything inside the following tags < > must be edited. For example, <user column> would be "users" (without "") if "users" was your user column in your database.

    NOTE: The query list will start small (because I can't think of every query), so if you want more queries released, post what ones you want me to make. All the queries are tested for r50+ servers using the Uber DB.


    -------------------------
    Update Queries
    -------------------------

    //Update users email
    UPDATE <user table> SET <email column> = '<email>' WHERE <username column> = '<username>'

    //Update users rank
    UPDATE <user table> SET <rank column> = '<rank>' WHERE <username column> = '<username>'

    //Update users motto
    UPDATE <user table> SET <motto column> = '<motto>' WHERE <username column> = '<username>'

    //Sets a user a specific amount of activity points (pixels)
    UPDATE <user table> SET <activity_points column> = '<pixel amount>' WHERE <username column> = '<username>'

    //Gives a user a specific amount of activity points (pixels)
    UPDATE <user table> SET <activity_points column> = <activity_points column> + '<pixel amount>' WHERE <username column> = '<username>'

    //Sets a user a specific amount credits
    UPDATE <user table> SET <credits column> = '<credit amount>' WHERE <username column> = '<username>'

    //Gives a user a specific amount credits
    UPDATE <user table> SET <credits column> = <credits column> + '<credit amount>' WHERE <username column> = '<username>'

    //Sets all users a specific amount of credits
    UPDATE <user table> SET <credits column> = '<credit amount>'

    //Gives all users a specific amount of credits
    UPDATE <user table> SET <credits column> = <credits column> + '<credit amount>'


    -------------------------
    Insert Queries
    -------------------------

    //Insert ban
    INSERT INTO <ban table> SET (<bantype>,<username column>,<reason column>,<expire column>,<added by column>, <added date column>,<appeal state column>) VALUES ('<user or ip>','<reason for the ban>','<expire date>','<added by username>','<added date>','<0-1-2>')

    //Insert badge (give a specific user a badge)
    INSERT INTO <user badge table> SET (user_id,badge_id,badge_slot) VALUES ('<user id>','<badge id/name>','<0-1-2-3-4-5-6>')

    Credits

    Code:
    TheJacob - 100% (for posting the queries, and finding them out using simple knowledge of SQL)
    Last edited by TheJacob; 22-08-10 at 06:58 AM.


  2. #2
    Valued Member xcv is offline
    MemberRank
    Aug 2010 Join Date
    114Posts

    Re: Useful Queries

    Thanks man. Very useful... I'll be using these alot ;D

  3. #3
    Account Upgraded | Title Enabled! Idiotic is offline
    MemberRank
    Jun 2010 Join Date
    MG, BrazilLocation
    228Posts

    Re: Useful MySQL Habbo Queries

    You should state for what server this is for, cause I'm sure there are many servers with different database structures. I really don't see the need of this, if someone needs help with writing a query, he/she should just visit SQL Tutorial. Neither do I see point of giving credits to yourself. A query can be written within a few seconds. I don't see anything special here.

  4. #4
    Account Upgraded | Title Enabled! LMC is offline
    MemberRank
    Apr 2009 Join Date
    United KingdomLocation
    429Posts

    Re: Useful MySQL Habbo Queries

    Quote Originally Posted by Idiotic View Post
    You should state for what server this is for, cause I'm sure there are many servers with different database structures. I really don't see the need of this, if someone needs help with writing a query, he/she should just visit SQL Tutorial. Neither do I see point of giving credits to yourself. A query can be written within a few seconds. I don't see anything special here.
    It dosent matter, as you would just change the <table name> to what table it is.

    Good stuff as well mate, will help the beginners.

  5. #5
    I'm back! iJay is offline
    MemberRank
    Nov 2008 Join Date
    Down Under ;)Location
    602Posts

    Re: Useful MySQL Habbo Queries

    Nice idea mate,

    Looking forward to the more advanced queries ;)

  6. #6
    Proficient Member mango2735 is offline
    MemberRank
    Jun 2010 Join Date
    176Posts

    Re: Useful MySQL Habbo Queries

    Love it .. XD

  7. #7
    TheJacob was here. TheJacob is offline
    MemberRank
    Jun 2010 Join Date
    Toronto, CanadaLocation
    326Posts

    Re: Useful MySQL Habbo Queries

    Guys I have ran out of ideas of other queries, if you get some spare time or need something, think of some queries and post what they'll do below, and I'll add them to my list. Sincerely appreciated + appropriate credits for idea (if unique).

    Thanks for all the positive feedback.

  8. #8
    Banned winterpartys is offline
    BannedRank
    Jan 2009 Join Date
    Australia, OLD.Location
    695Posts

    Re: Useful MySQL Habbo Queries

    A little skid could make the querys!

    You can even edit in phpMyAdmin, So stop being up yourself that you know how to code a simple line of PHP.

    Oh by the way, use mysql_real_escape_string() otherwise people can SQL inject.
    Last edited by winterpartys; 22-08-10 at 03:57 AM.

  9. #9
    TheJacob was here. TheJacob is offline
    MemberRank
    Jun 2010 Join Date
    Toronto, CanadaLocation
    326Posts

    Re: Useful MySQL Habbo Queries

    Quote Originally Posted by winterpartys View Post
    A little skid could make the querys!

    You can even edit in phpMyAdmin, So stop being up yourself that you know how to code a simple line of PHP.

    Oh by the way, use mysql_real_escape_string() otherwise people can SQL inject.
    I don't think you've noticed but first of all, about 70% of RaGEZONE doesn't know anything about HTML, PHP let alone SQL. Second of all, even skiddies like you don't know most of these since you go to your existing db and try a bunch of things praying they work, or edit the tables manually. Third of all, these are queries people will use in their db, so mysql_real_escape_string($variable) isn't even needed, so you wasted your time googling your reply. Forth of all, this isn't a flame post, if you'd like to flame go and flame your mom for giving you the unusual habbit of picking your nose.

  10. #10
    Banned winterpartys is offline
    BannedRank
    Jan 2009 Join Date
    Australia, OLD.Location
    695Posts

    Re: Useful MySQL Habbo Queries

    Quote Originally Posted by TheJacob View Post
    I don't think you've noticed but first of all, about 70% of RaGEZONE doesn't know anything about HTML, PHP let alone SQL. Second of all, even skiddies like you don't know most of these since you go to your existing db and try a bunch of things praying they work, or edit the tables manually. Third of all, these are queries people will use in their db, so mysql_real_escape_string($variable) isn't even needed, so you wasted your time googling your reply. Forth of all, this isn't a flame post, if you'd like to flame go and flame your mom for giving you the unusual habbit of picking your nose.
    Calm down, don't wet your panties. We don't like people who are up themselves!

    Because thats what annoys me! I'm not flaming, I'm saying I don' like your release :)

    And btw I didn't google anything, I know PHP and I know exploits in SQL Queries. The reason why people don't know about HTML and PHP is because they don't bother. Everyone has potential.
    Last edited by winterpartys; 22-08-10 at 04:15 AM.

  11. #11
    < !--#exec cmd="dir" -- > axaver is offline
    MemberRank
    Sep 2007 Join Date
    every where :PLocation
    311Posts

    Re: Useful MySQL Habbo Queries

    thanks for sharing it with us

  12. #12
    TheJacob was here. TheJacob is offline
    MemberRank
    Jun 2010 Join Date
    Toronto, CanadaLocation
    326Posts

    Re: Useful MySQL Habbo Queries

    Quote Originally Posted by axaver View Post
    thanks for sharing it with us
    You're welcome. Feel free to suggest queries to add, or post your own queries and I'll add them above.

  13. #13
    I'm back! iJay is offline
    MemberRank
    Nov 2008 Join Date
    Down Under ;)Location
    602Posts

    Re: Useful MySQL Habbo Queries

    Quote Originally Posted by TheJacob View Post
    Guys I have ran out of ideas of other queries, if you get some spare time or need something, think of some queries and post what they'll do below, and I'll add them to my list. Sincerely appreciated + appropriate credits for idea (if unique).

    Thanks for all the positive feedback.
    Ideas:

    Mass credits querie - Gives all users a certain amount of credits.
    Mass badge querie - Gives all users a certain badge.
    Rank querie - Change a users rank

  14. #14
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: Useful MySQL Habbo Queries

    Nice to see you contributing in a different way.
    ;)

  15. #15
    Member AnthonyColon is offline
    MemberRank
    Oct 2009 Join Date
    San FranciscoLocation
    58Posts

    Re: Useful MySQL Habbo Queries

    Set All Users Credits to a Specific Amount.

  16. #16
    TheJacob was here. TheJacob is offline
    MemberRank
    Jun 2010 Join Date
    Toronto, CanadaLocation
    326Posts

    Re: Useful MySQL Habbo Queries

    Quote Originally Posted by AnthonyColon View Post
    Set All Users Credits to a Specific Amount.
    Done. Be careful between "SET" and "GIVES". Gives will add to their current credit amount, SET will override their current amount (read the commented out part in green for details above each query).

    Quote Originally Posted by iJay View Post
    Ideas:

    Mass credits querie - Gives all users a certain amount of credits.
    Mass badge querie - Gives all users a certain badge.
    Rank querie - Change a users rank
    Mass credits Done. Badge - Doing. Rank - Done already.

  17. #17
    Account Upgraded | Title Enabled! Sledmore is offline
    MemberRank
    Jun 2009 Join Date
    1,133Posts

    Re: Useful MySQL Habbo Queries

    Nice queries, some of they're all useful, i probably wont need them though :').

  18. #18
    I'm back! iJay is offline
    MemberRank
    Nov 2008 Join Date
    Down Under ;)Location
    602Posts

    Re: Useful MySQL Habbo Queries

    Quote Originally Posted by TheJacob View Post
    Mass credits Done. Badge - Doing. Rank - Done already.

    Well done mate ;)

  19. #19
    TheJacob was here. TheJacob is offline
    MemberRank
    Jun 2010 Join Date
    Toronto, CanadaLocation
    326Posts

    Re: Useful MySQL Habbo Queries

    Quote Originally Posted by Sledmore View Post
    Nice queries, some of they're all useful, i probably wont need them though :').
    You're welcome and thanks.

    Quote Originally Posted by iJay View Post
    Well done mate ;)
    You're welcome.

    If anyone has any requests, post them here. Requests/Ideas are appreciated (I am trying to setup a big list of useful queries - personal reasons).

  20. #20
    I'm back! iJay is offline
    MemberRank
    Nov 2008 Join Date
    Down Under ;)Location
    602Posts

    Re: Useful MySQL Habbo Queries

    Quote Originally Posted by TheJacob View Post
    You're welcome and thanks.



    You're welcome.

    If anyone has any requests, post them here. Requests/Ideas are appreciated (I am trying to setup a big list of useful queries - personal reasons).
    How about a pixels query?

    Or even queries to insert pets, bots etc.

    Not sure.. Just ideas

  21. #21
    TheJacob was here. TheJacob is offline
    MemberRank
    Jun 2010 Join Date
    Toronto, CanadaLocation
    326Posts

    Re: Useful MySQL Habbo Queries

    Quote Originally Posted by iJay View Post
    How about a pixels query?

    Or even queries to insert pets, bots etc.

    Not sure.. Just ideas
    I've already setup a query to insert Pixels (activity points). Pets, hmm... like to just give a pet to someone? and what do you mean by bots?

  22. #22
    Alpha Member Zak© is offline
    MemberRank
    Oct 2007 Join Date
    2,693Posts

    Re: Useful MySQL Habbo Queries

    thanks Jacob

  23. #23
    Web Developer Markshall is offline
    MemberRank
    Oct 2009 Join Date
    EnglandLocation
    628Posts

    Re: Useful MySQL Habbo Queries

    The first four are fucking useless, you could just post one and let the user edit the code, turn:

    PHP Code:
    //Update users email
    UPDATE <user tableSET <email column> = '<email>' WHERE <username column> = '<username>'

    //Update users rank
    UPDATE <user tableSET <rank column> = '<rank>' WHERE <username column> = '<username>'

    //Update users motto
    UPDATE <user tableSET <motto column> = '<motto>' WHERE <username column> = '<username>'

    //Sets a user a specific amount of activity points (pixels)
    UPDATE <user tableSET <activity_points column> = '<pixel amount>' WHERE <username column> = '<username>' 
    to:

    PHP Code:
    //Update user row
    UPDATE <user tableSET <user_row> = '<update_with>' WHERE <user_name> = '<user_name>' 
    Sorted?

  24. #24
    Proficient Member Hydros1 is offline
    MemberRank
    May 2010 Join Date
    156Posts

    Re: Useful MySQL Habbo Queries

    Yo can you release the snippet of checking weather a user is online to display the online image or offline image.

    This is for phpretro, if not don't warry.

    Ontopic: This is great, but pretty simple haha.

  25. #25
    TheJacob was here. TheJacob is offline
    MemberRank
    Jun 2010 Join Date
    Toronto, CanadaLocation
    326Posts

    Re: Useful MySQL Habbo Queries

    Quote Originally Posted by Hydros1 View Post
    Yo can you release the snippet of checking weather a user is online to display the online image or offline image.

    This is for phpretro, if not don't warry.

    Ontopic: This is great, but pretty simple haha.
    Like how to tell if a user is online and/or offline? Sure I'll post a query above. Good suggestion.

    Does anyone else have any suggestions?



Page 1 of 2 12 LastLast

Advertisement