Skip to content

Instantly share code, notes, and snippets.

@wokka1
Last active December 5, 2017 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wokka1/b83a1494d5dc466d96bde204d5e4dad4 to your computer and use it in GitHub Desktop.
Save wokka1/b83a1494d5dc466d96bde204d5e4dad4 to your computer and use it in GitHub Desktop.
skript-db errors
on load:
#
# Dependent on skript-db plugin
#
set {sql} to the database "mysql://localhost:3306/dbname?user=dbuser&password=dbpw&useSSL=false"
#table_index
#id, table num, table name, name of bot
execute "CREATE TABLE IF NOT EXISTS table_index (id INT NOT NULL AUTO_INCREMENT, table_num INT, table_name VARCHAR(50), table_botname VARCHAR(50), PRIMARY KEY(id));" in {sql} and store the result in {output::*}
#table_player
#id, player, table num, table state
execute "CREATE TABLE IF NOT EXISTS table_player (id INT NOT NULL AUTO_INCREMENT, table_playername VARCHAR(50), table_player_num INT, table_player_state VARCHAR(50), PRIMARY KEY(id));" in {sql} and store the result in {output::*}
command /testdb:
permission: group.admin
trigger:
execute "select table_player_num from table_player where table_playername = '%{player}%';" in {sql} and store the result in {_test}
set {_last_error} to the last sql error
send "player: %player% - table num : %{_test}%"
send "error: %{_last_error}%"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment