can't update the database sqlite3

hello, i need some help with updating my local database with sqlite3

i already create the table and insert 1 row. my table name is userAcc

i create when opened first time

function dbColumnExists(dbase, tbl, col) local sql = "select \* from "..tbl.." limit 1;" local stmt = dbase:prepare(sql) local tb = stmt:get\_names() local found = false for v = 1, stmt:columns() do print(tb[v]); if tb[v] == col then found = true; print("FOUND "..tb[v]); end end return found end local tablesetup10 = [[CREATE TABLE IF NOT EXISTS userAcc (username Varchar(255) PRIMARY KEY, pathTopi);]] db:exec( tablesetup10 ) if not dbColumnExists( db, "userAcc", "pathBaju") then local sql2 = "alter table userAcc add column pathBaju" db:exec(sql2) end local tablefill = 'insert into userAcc(username) values (\''..globals.username..'\');' print(tablefill) db:exec( tablefill )

the create table and the insert is fine. and when i want to update it from different scene, i got nothing error. i print the db:exec(sql2) return 0.

the code is below.

if (row.pathBaju==nil) then sql2 = [[UPDATE userAcc SET pathTopi=']]..pathGambar..[[';]] print(sql2) print (db:exec(sql2)) db:exec(sql2) cekDownloadEqTidak() else local function onComplete( event ) if "clicked" == event.action then if 1 == i then print("di klik no") tekenX(); elseif 2 == i then sql2 = [[UPDATE userAcc SET pathTopi=']]..pathGambar..[[';]] db:exec(sql2) cekDownloadEqTidak() end end end alert = native.showAlert( "confirmation", "ALREADY GOT EQUIPED ITEM, WANT TO UNEQUIP AND EQUIP THIS ITEM?", { "NO", "YES" }, onComplete ) end

thank you

Where do you create the database?

Rob

Where do you create the database?

Rob