What happens is whenever I run my app, I insert a new record in my database for one time only, but whenever I open the app, data keeps on inserting, here’s my code
--Open PlateNumbers.db. If the file doesn't exist it will be created local path = system.pathForFile("PlateNumbers.db", system.DocumentsDirectory) db = sqlite3.open( path ) local tblPlates = [[CREATE TABLE IF NOT EXISTS Plates (id INTEGER PRIMARY KEY, platenum);]] db:exec(tblPlates) --Insert Data local tablefill = [[INSERT INTO Plates VALUES (null,'ILY-143');]] db:exec(tablefill) --Reads all Data for row in db:nrows([[SELECT \* FROM Plates WHERE platenum LIKE '%]]..day..[[' OR platenum LIKE '%]]..day2..[[']]) do
so basically ones opened it keeps on creating a new one