[code]
local query = "CREATE TABLE cl_db ( "
query = query .. "name TEXT, "
query = query .. "value INTEGER"
query = query .. " );"
local result = sql.Query( query )
if result == false then
print( sql.LastError() )
end
[/code]
console:
database disk image is malformed
i tried some sql an this is was printed out
how can i fix that / what is wrong?
Use [URL="http://sqlitebrowser.org/"]SQLite browser[/URL] to extract tables which have data you wan't to keep into a new sv.db file. You have corrupted your database.
You can also make a new database with sqlite browser. Once you have a new database lets go over the code...
-------------------------------------------
There is [B]no[/B] reason (far as I can see) for concatenation of your variable [B][I]query[/I][/B]. You don't event need to put the query in a variable, but if you must, it should just look like this
[CODE]
local query = "CREATE TABLE cl_db (name TEXT, value INTEGER)"
-- somewhere else in the code
sql.Query(query)
[/CODE]
But usually, your query would look like this:
[CODE]
sql.Query("CREATE TABLE cl_db (name TEXT, value INTEGER)")
[/CODE]
Sorry, you need to Log In to post a reply to this thread.