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)
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.
Re: Useful MySQL Habbo Queries
Quote:
Originally Posted by
Idiotic
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.
Re: Useful MySQL Habbo Queries
Nice idea mate,
Looking forward to the more advanced queries ;)
Re: Useful MySQL Habbo Queries
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.
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.
Re: Useful MySQL Habbo Queries
Quote:
Originally Posted by
winterpartys
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.
Re: Useful MySQL Habbo Queries
Quote:
Originally Posted by
TheJacob
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.
Re: Useful MySQL Habbo Queries
thanks for sharing it with us
Re: Useful MySQL Habbo Queries
Quote:
Originally Posted by
axaver
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.
Re: Useful MySQL Habbo Queries
Quote:
Originally Posted by
TheJacob
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
Re: Useful MySQL Habbo Queries
Nice to see you contributing in a different way.
;)
Re: Useful MySQL Habbo Queries
Set All Users Credits to a Specific Amount.