undefined Posted June 23, 2016 Share Posted June 23, 2016 local database = dbConnect("sqlite", "parchement.db") dbExec(database, "CREATE TABLE IF NOT EXISTS parchement (account_name TEXT, parchement TEXT DEFAULT "..toJSON({})..")") WARNING: system\save\save.lua:2: dbExec failed; (1) unrecognized token: "]" Where is the problem? Link to comment
xXMADEXx Posted June 24, 2016 Share Posted June 24, 2016 Try putting the toJSON in single quotes. local database = dbConnect("sqlite", "parchement.db") dbExec(database, "CREATE TABLE IF NOT EXISTS parchement (account_name TEXT, parchement TEXT DEFAULT '"..toJSON({}).."')") I'm honestly not sure if this will fix the problem though. Link to comment
Noki Posted June 24, 2016 Share Posted June 24, 2016 (edited) You can't set defaults for text fields in MySQL. Edit: didn't see it was SQLite. Silly me. Edited June 26, 2016 by Guest Link to comment
undefined Posted June 25, 2016 Author Share Posted June 25, 2016 Try putting the toJSON in single quotes. local database = dbConnect("sqlite", "parchement.db") dbExec(database, "CREATE TABLE IF NOT EXISTS parchement (account_name TEXT, parchement TEXT DEFAULT '"..toJSON({}).."')") I'm honestly not sure if this will fix the problem though. Solved, thank you. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now