How do I view sqlite db.

Ok. I found the resource directory

This directory refers to the core project directory which is the same location as the main.lua

Oh you should probably save it in the DocumentsDirectory. That is usually the standard db procedure

[lua]

local sqlite3 = require “sqlite3”
 
local path = system.pathForFile(“data.db”, system.DocumentsDirectory)
db = sqlite3.open( path )
    
–Generate the myteam, the team that the player chose to play for and any custom lineups
db:exec[[CREATE TABLE usersaves (saveindex INTEGER, savename TEXT, savedesc TEXT, savedate TEXT, contents TEXT);]]

–Test values to insert
local gdata = {saveindex = 1, savename = “Test save”, savedesc = “Random description”, savedate = “Random date”}
local contents = “Nothing”

local stmt = db:prepare[[INSERT INTO usersaves VALUES( ?, ?, ?, ?, ?)]]
stmt:bind_values( gdata.saveindex, gdata.savename, gdata.savedesc, gdata.savedate, contents)
stmt:step()

db:close();

[/lua]

Are you missing anything from the sample code I have written above?

ok progress being made.

I moves db back to resource dir (mentioned above). I found code to check if file exists and copy.

I copy db from res dir to doc dir if file does not exist in doc dir.

This works.

I downloaded the sqlite pro from app store.

I am able to view db and table now.

Still not able to insert.

I tried the insertquery from initial post.

I will try 14 thru 17 now.

Ok. changed insertquery to stmt.

It works. WooHoo!!

Thank you astrizhong.

Have a great day.