Someone knows why when i want to execute and query to mysql i get this; Code: [13:27:29] [Server thread/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 'Fly=false WHERE ID='92eb937a-b761-33d8-befa-0d9c5329283c'' at line 1 Code:java public static void addPlayer(UserData user){ if(con != null){ try{ Statement st = con.createStatement(); st.execute("INSERT INTO OpenTools_Users VALUES('" + user.getUserID() + "', " + user.isGod() + ", " + user.isFly() + ")"); st.close(); } catch(SQLException sqle){ sqle.printStackTrace(); } } } public static void updateUser(UserData user){ if(con != null){ try{ Statement st = con.createStatement(); st.execute("UPDATE OpenTools_Users SET God=" + user.isGod() + " Fly=" + user.isFly() + " WHERE ID='" + user.getUserID() + "'"); st.close(); } catch(SQLException sqle){ sqle.printStackTrace(); } } } It shows error but anyway it adds newplayer to mysql, how can i fix that warning?
DevManABCD Your insert query is fine, but your update query is wrong. When updating more than 1 column you have to use comma's after every column. Code:java st.execute("UPDATE OpenTools_Users SET God=" + user.isGod() + ", Fly=" + user.isFly() + " WHERE ID='" + user.getUserID() + "'"); Next time look at the error that you got. It says exactly where in the query something is going wrong.