本地函數的GetList()如何返回一個列表,以及如何接取在Lua這些值
local select_stmt = db:prepare("SELECT * FROM list")
return select_stmt:rows();
end
local rows = getList();
--**here i need to print the rows list, how I can print using for loop**
--************************************************
**here I want to fetch single record, I am unable to fetch and print it?**
local function getListRecord(listId)
local select_stmt = db:prepare("SELECT * FROM list where id = ?")
select_stmt:bind_names{ id = listId }
return select_stmt:get_unames()-- i AM GETTING ERROR HERE
end
local row = getListRecord(3);
--I am unable to get the row here, please help me
Duplicate:http://stackoverflow.com/questions/6344068/how-to-return-array-list-in-lua-program – BMitch 2011-06-15 10:42:45