Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

How do I add data to the mysql database?

Junior Spellweaver
Joined
Mar 2, 2023
Messages
196
Reaction score
326
Is it possible to somehow add (update a row) in the database from the server script?

For example:

File: HaramelInstance.java (GameServer\data\scripts\system\handlers\instance)

Update the value in the players_bosskill table (Which I created in advance in the game server database)

Снимок.PNG - How do I add data to the mysql database? - RaGEZONE Forums


Need to change the value from 2 to 3 in the kill_hamerun column (you can see in the screenshot)

The request itself looks like this:

SQL:
UPDATE players_bosskill SET kill_hamerun = kill_hamerun +1 WHERE player_id = 320140
 

Attachments

You must be registered for see attachments list
Newbie Spellweaver
Joined
Apr 9, 2016
Messages
72
Reaction score
22
It's easy, just get connection, than prepared statement and use update. Example you can see in MYSQL5Dao scripts
 
Upvote 0
Junior Spellweaver
Joined
Mar 2, 2023
Messages
196
Reaction score
326
It's easy, just get connection, than prepared statement and use update. Example you can see in MYSQL5Dao scripts

God, I'm an idiot... Why didn't I guess myself to go to the DAO scripts, see... TY!

Снимок.PNG - How do I add data to the mysql database? - RaGEZONE Forums


it works :love:
 

Attachments

You must be registered for see attachments list
Upvote 0
Back
Top