insert in mysql

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

ZxFrankxZ

Member
Jan 5, 2021
1
0
1
23
Hi, when someone connect the skript dont insert nothing in database but if i replace %player% and %ip of player% to any text this works.
Why?

Code:
on load:
    set {sql} to the database "mysql://<ip>:3306/<database>?user=<user>&password=<password>useSSL=false"
    execute "CREATE TABLE IF NOT EXISTS `joinIPs` (`id` INT AUTO_INCREMENT PRIMARY KEY, `username` TEXT, `ip` TEXT, `hora` TIMESTAMP DEFAULT CURRENT_TIMESTAMP)" in {sql}

on connect:
    execute "INSERT INTO `joinIPs` (`username`, `ip`) VALUES (%player%, %ip of player%)" in {sql}
 
Status
Not open for further replies.