You would have to grab the value, perform the operations you want to it, and then update the value in the database.Let's say I want to subtract one value from the database from another, but I can't do that
does not work arithmetic calculations
Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.
If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!
Now, what are you waiting for? Join the community now!
You would have to grab the value, perform the operations you want to it, and then update the value in the database.Let's say I want to subtract one value from the database from another, but I can't do that
does not work arithmetic calculations
It won't lag the server using this addon since it's done asynchronously to avoid that.will use Mysql lag the server?
if the MYSQL is at external place, if that server is disconnected, will it lag the server and if make a shop with skript-db MYSQL , will be player keep to get items from shop but the data will not be deducted because MYSQL is disconnect due to some issue ?It won't lag the server using this addon since it's done asynchronously to avoid that.
on script load:
set {sql} to the database "mysql://185.227.81.30:3306/dylannl_status?user=dylannl_status&password=blegh&useSSL=false"
execute "CREATE TABLE IF NOT EXISTS `test` (`name` varchar(255), `displayname` varchar(255))" in {sql}
Database calls are made on a separate thread, so they will not hang your server.if the MYSQL is at external place, if that server is disconnected, will it lag the server and if make a shop with skript-db MYSQL , will be player keep to get items from shop but the data will not be deducted because MYSQL is disconnect due to some issue ?
thanksDatabase calls are made on a separate thread, so they will not hang your server.
As for your second issue, that depends on how your script is set up. As long as you give the player items after the database transaction is complete, you'll be fine.
"INSERT INTO users (id, player_uuid, username) values (7, 'a438454d-3859-3ed6-b009-7306ccb429b2', 'lol')"
command /hello:
trigger:
set {sql} to the database "jdbc:sqlite:/C:/Users/Valentin/Desktop/Jeux/Minecraft/Serveurs/SkriptCraft/plugins/Jobs/jobs.sqlite.db"
execute "SELECT * FROM users WHERE username = 'lol'" in {sql} and store the result in {_output::*}
loop {_output::*}:
message "%loop-value%"
message "%last database error%"
message "%{_output::id}%"
You have to loop through {_output::<column>::*}, like {_output::id::*}Lol's id is 7, I added the player "lol" usingand it worked, but when I try to get values from the ddb, it always return the column names istead of the result :/code_language.skript:"INSERT INTO users (id, player_uuid, username) values (7, 'a438454d-3859-3ed6-b009-7306ccb429b2', 'lol')"
My code:
output: View attachment 2135code_language.skript:command /hello: trigger: set {sql} to the database "jdbc:sqlite:/C:/Users/Valentin/Desktop/Jeux/Minecraft/Serveurs/SkriptCraft/plugins/Jobs/jobs.sqlite.db" execute "SELECT * FROM users WHERE username = 'lol'" in {sql} and store the result in {_output::*} loop {_output::*}: message "%loop-value%" message "%last database error%" message "%{_output::id}%"
set {sql} to the database "mysql://127.0.0.1:3306/ferox?user=root&password=[password that works with mysql from the commandline]&useSSL=false" Any idea why this doesn't work with my mariadb instance?
it worked on my old server which used default mysql but this doesnt while mariadb is supposed to be a drop-in replacement.
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
command /dbtest:
trigger:
execute "SELECT count(*)+1 FROM istatistik WHERE deger > (SELECT deger FROM istatistik WHERE isim = '%player%' and stat='sw.puan')" in {sql} and store the result in {siralamadeneme}
wait 1 tick
broadcast "%{siralamadeneme}%"
Use %player's name% or %player's uuid% instead of '%player%'code_language.skript:command /dbtest: trigger: execute "SELECT count(*)+1 FROM istatistik WHERE deger > (SELECT deger FROM istatistik WHERE isim = '%player%' and stat='sw.puan')" in {sql} and store the result in {siralamadeneme} wait 1 tick broadcast "%{siralamadeneme}%"
NOT WORK :C PLZ HELP
What are you trying to do?any way to store lists? such ascode_language.skript:{player.arrow-trails::*}
You'll have to convert your list into a single object when storing it in the database and convert it back when you retrieve it.sync a list of materials that player has, {player.arrow-trails::*} = diamond_block,noteblock...
on skript load:
set {sql} to the database "mysql://139.99.8.33:3306/mc44732?user=mc44732&password=***&useSSL=false"
wait 1 tick
execute "UPDATE Ekonomi SET `Bronze`=`Bronze`+1 WHERE Player=""CyanideToDeath""" in {sql}