sqlite don't create table?

Hi!

Here’ s my source

  

     local path = system.pathForFile("appleBox.db", system.DocumentsDirectory);         db = sqlite3.open( path );         local tablesetup = [[CREATE TABLE IF NOT EXISTS appleBox\_Run (id INTEGER PRIMARY KEY, value);]]         db:exec( tablesetup )         for row in db:nrows("SELECT \* FROM appleBox\_Run Where id = 1") do             print("why i can't get here?")             if ((row.value == null) or (row.value == "")) then                     local insertQuery = [[INSERT INTO appleBox\_Run VALUES (1, 0);]]                     db:exec( insertQuery )             end         end         local tablegameCore = [[CREATE TABLE IF NOT EXISTS appleBox\_Core (id INTEGER PRIMARY KEY autoincrement, point);]]         db:exec( tablegameCore )         Play = display.newImage( "\_img/play.png",400, 710, true)         for row in db:nrows("SELECT value FROM appleBox\_Run Where id = 1") do             print("and here");                 if row.value == 0 then                     Play.touch = StartFirstPlay;                 end                                  if row.value == 1 then                     Play.touch = StartPlay;                 end         end  

when i touch Play button nothing happen, even mu console log does’n appear. Any ideas why it may happen?

Thanks for sugesttion in advice

Your code is creating the database and the tables, however there’s no data in the tables.

The SELECT statements do not return any rows which means the for-loop is never entered. That’s why you don’t see any logs in your console. 

Your code is creating the database and the tables, however there’s no data in the tables.

The SELECT statements do not return any rows which means the for-loop is never entered. That’s why you don’t see any logs in your console.