How to use SQLite3?
#10
Hey, I tested a little bit around but I dont understand why the following code wont work. The first query is working. The Table is created but the Insert dont work. But why? Can someone please tell me what I did wrong.
PLUGIN = nil
function Initialize(Plugin)
	Plugin:SetName("NewPlugin")
	Plugin:SetVersion(1)

	PLUGIN = Plugin
	
	LOG("Initialised " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
	
	TestDB = {}
	
	TestDB = sqlite3.open(\'TestDB.sqlite3\')
	
	local sql = "CREATE TABLE IF NOT EXISTS TestTable(ID PRIMARY KEY,One,Two)"
	TestDB:exec(sql)
	local sqlq = "INSERT INTO TestTable(ID,One,Two) VALUES (\'25\',\'35\',\'45\')"
	TestDB:exec(sqlq)
	
	TestDB:close()
		
	return true
end

function OnDisable()
	LOG(PLUGIN:GetName() .. " is shutting down...")
end
Thanks a lot!
Greetings Aggro
Reply
Thanks given by:


Messages In This Thread
How to use SQLite3? - by Shadowraix - 05-08-2015, 12:28 PM
RE: How to use SQLite3? - by xoft - 05-08-2015, 05:15 PM
RE: How to use SQLite3? - by Shadowraix - 05-10-2015, 12:21 AM
RE: How to use SQLite3? - by Shadowraix - 05-10-2015, 10:39 AM
RE: How to use SQLite3? - by xoft - 05-10-2015, 03:59 PM
RE: How to use SQLite3? - by Shadowraix - 05-10-2015, 04:13 PM
RE: How to use SQLite3? - by LogicParrot - 05-10-2015, 11:42 PM
RE: How to use SQLite3? - by NathanFlurry - 05-11-2015, 04:27 AM
RE: How to use SQLite3? - by xoft - 05-11-2015, 07:31 AM
RE: How to use SQLite3? - by Aggroblut - 06-02-2015, 01:43 AM
RE: How to use SQLite3? - by xoft - 06-02-2015, 02:07 AM



Users browsing this thread: 1 Guest(s)