Quick 3.3rc1 在lua中使用sqlite3 获取不到指定表的内容


require("lsqlite3")

local MainScene = class("MainScene", function()
    return display.newScene("MainScene")
end)

function MainScene:ctor()

        local db = sqlite3.open("nf_static.db")
        local isOpen = db:isopen()
        dump(isOpen)
        for row in db:rows("SELECT * FROM t_npc_info") do  
            dump(row)
    end
    db:cloase()
end

输出log是这样的

CONFIG_SCREEN_AUTOSCALE = FIXED_HEIGHT

CONFIG_SCREEN_WIDTH = 960.00

CONFIG_SCREEN_HEIGHT = 640.00

display.widthInPixels = 960.00

display.heightInPixels = 640.00

display.contentScaleFactor = 1.00

display.width = 960.00

display.height = 640.00

display.cx = 480.00

display.cy = 320.00

display.left = 0.00

display.right = 960.00

display.top = 640.00

display.bottom = 0.00

display.c_left = -480.00

display.c_right = 480.00

display.c_top = 320.00

display.c_bottom = -320.00

dump from: :11: in function ‘ctor’

  • “” = true
    no such table: t_npc_info

问题 是我调用的方法不对吗? 怎么样才能真确获取表里面的数据
PS:
1.数据库里面有这个表 而且有数据。
2.是在mac上运行的。

看提示就是没找到表,再检查下表名大小写,是不是有不规范的字符之类的呢

我确认了下 不是你说的这个问题。