Jump to content

Unrecognized Token


Recommended Posts

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

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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...