MySQL problem.

Discussion in 'Plugin Development' started by BloodBacker, Aug 2, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    BloodBacker

    Hi all.

    First i have to tell. i'm not the best with datbase.

    But this is my error & code.

    Error:
    Code:
    02.08 14:06:28 [Server] WARN com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

    Code:
    Code:java
    1. statement.executeUpdate("CREATE TABLE IF NOT EXISTS " + prefix + " (player_name VARCHAR(20), Coins int, Kills int, Deaths int");



    The code is were the error is(the error is after 'Death int'

    I have you guys can help me!
     
  2. Offline

    QuecksilberHD

    You forget a ")" ^^

    Change it to
    Code:
    statement.executeUpdate("CREATE TABLE IF NOT EXISTS " + prefix + " (player_name VARCHAR(20), Coins int, Kills int, Deaths int"));
     
  3. Offline

    Aqua

    BloodBacker
    Almost, keep the ) inside the ""
    Code:
    statement.executeUpdate("CREATE TABLE IF NOT EXISTS " + prefix + " (player_name VARCHAR(20), Coins int, Kills int, Deaths int)");
     
Thread Status:
Not open for further replies.

Share This Page