hey guys ive just noted that when booting the server it gives out this error
java.sql.SQLException: near "group": syntax error
Syntax error
- yahgiggle
- Closed
- Thread is marked as Resolved.
-
-
ok after looking at this i worked it out that the error was from the admin script
so i removed the line by adding -- at the start
-- Group management DB entry
database:queryupdate("CREATE TABLE IF NOT EXISTS player (ID INTEGER PRIMARY KEY NOT NULL, name VARCHAR NOT NULL, groupID INTEGER);");
-- database:queryupdate("CREATE TABLE IF NOT EXISTS group (ID INTEGER PRIMARY KEY NOT NULL, name VARCHAR NOT NULL, adminID INTEGER NOT NULL);");
database:queryupdate("CREATE TABLE IF NOT EXISTS groupAdmin (ID INTEGER PRIMARY KEY NOT NULL, admin1 INTEGER, admin2 INTEGER, admin3 INTEGER);");this has fixed the error but what i want to now know is why was this line giving this error it looks fine to me
-
"group" is a reserved keyword in SQL. To use it anyway, you have to use quot. marks, e.g.:
database:queryupdate("CREATE TABLE IF NOT EXISTS 'group' (ID INTEGER PRIMARY KEY NOT NULL, name VARCHAR NOT NULL, adminID INTEGER NOT NULL);"); -
cheers red, of cause i should know this its the same thing with php but its been some years and i am a little rusty lol
Participate now!
Don’t have an account yet? Create a new account now and be part of our community!