Syntax error

  • 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

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png
  • "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

    Yahgiggle Steam Signature, real name Deon Hamilton :thumbsup: Server @ ip 139.99.136.76:4255 Name (The Federation of territory) Unity :thumbsup:

    If at first your code does not work call it version 0.1 with the odd bug :thinking:

    My Own Website




    31245-logo-png

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!