1. Welcome to skUnity!

    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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

skript-db (Updated)

Discussion in 'Addon Releases' started by Govindas, Feb 1, 2021.

  1. Govindas

    Govindas Active Member

    Joined:
    Feb 5, 2017
    Messages:
    79
    Likes Received:
    5
    Code (Text):
    1. Awesome direct database access for Skript
    What makes skript-db different from other SQL addons?
    • Automatic SQL injection protection
    • Support for connections to multiple databases
    • An amazingly intuitive list variable system for reading query outputs
    This is a fork of btk5h's skript-db, with these changes:
    • Fixed local variables disappearance in newer Skript versions
    • Thread-pool size is now configurable
    • Uses a newer version of HikariCP
    • Only meant to be used by newer Minecraft versions (1.8 is not supported)
    Documentation/Source - Releases

    Quickstart
    Code (Text):
    1. on script load:
    2.   set {-sql} to the database "mysql://localhost:3306/mydatabase?user=admin&password=12345&useSSL=false"
    Code (Text):
    1. command /dbtest:
    2.   trigger:
    3.     execute "select * from table" in {-sql} and store the result in {_output::*}
    4.     send "First entry in column: %{_output::columnname::1}%"
     
  2. jiri

    jiri Member

    Joined:
    Jan 18, 2020
    Messages:
    2
    Likes Received:
    0
    execute "UPDATE `stat` SET `%loop-value%` = %{stat.%loop-value%.%player's name%}% WHERE `stat`.`VarName` = %player's name%" in {sql}

    It's not error,but it can't update the datebase and no any effect
    --- Double Post Merged, Sep 2, 2021, Original Post Date: Sep 2, 2021 ---
    execute "UPDATE `stat` SET `health` = %{_text}% WHERE `stat`.`VarName` = %arg-1%" in {sql}
    However, this is the test I wrote before. It can update the database
     

Share This Page

Loading...