Wait so you are able to open usersaves.sqlite, but for some reason, you see no records in the database when you open it? Is that what is happening.
If so, I assume that you are trying to insert text values into your database, therefore, your query won’t work:
[lua]
[[INSERT INTO usersaves VALUES (gdata.saveindex, gdata.savename, gdata.savedesc, gdata.savedate, contents)]]
[/lua]
^Treat that query as an entire string without any context, the database won’t know what gdata.saveindex is because it is part of the string
What you should do is use parameterized queries:
[lua]
local stmt = db:prepare[[INSERT INTO usersaves VALUES( ?, ?, ?, ?, ?)]]
stmt:bind_values( gdata.saveindex, gdata.savename, gdata.savedesc, gdata.savedate, contents)
stmt:step()
[/lua]
Further reading on parameterized queries in lua:
http://www.nessie.de/mroth/lua-sqlite3/documentation.html#ref11
http://lua.sqlite.org/index.cgi/doc/tip/doc/lsqlite3.wiki#methods_for_prepared_statements