• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

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)



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!



it works
 

Attachments

You must be registered for see attachments list
Upvote 0