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)





