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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

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

Solved MySQL DB connect

Discussion in 'Skript' started by Wolwer, Aug 16, 2019 at 8:24 AM.

Tags:
  1. Wolwer

    Wolwer Well-Known Member

    Joined:
    Feb 8, 2018
    Messages:
    48
    Likes Received:
    3
    Hi. I need help.

    I need to write data in my mysql database with bans data.

    For example:

    Database: 'skBans'
    -------|-------------|---------|-------------
    | ID | Name | time | Reason
    ---------------------------------------------

    So should I use this: https://forums.skunity.com/resources/mysql-manager-skript-2-2-skquery.130/
    Or I should write login and pass in config.sk?
    And how to write data into database?

    Please, help. <3
     
  2. Best Answer:
    Post #2 by malia, Aug 16, 2019 at 6:12 PM
  3. malia

    malia Well-Known Member

    Joined:
    Jul 24, 2019
    Messages:
    189
    Likes Received:
    17
    You need to learn SQL before attempting to mess with databases (it can get really messy specially on websites)

    Code (Skript):
    1. on script load:
    2.   set {sql} to the database "mysql://localhost:3306/mydatabase?user=admin&password=12345&useSSL=false"
    3.  
    4. command /dbtest:
    5.   trigger:
    6.     execute "select * from table" in {sql} and store the result in {output::*}
    https://forums.skunity.com/resources/skript-db.372/
     
Loading...