help with manipulating object

local localGroup = display.newGroup()  
require "sqlite3"  
local dbPath = system.pathForFile ("database.sqlite", system.DocumentsDirectory)  
local db = sqlite3.open(dbPath)  
  
for row in db:nrows("SELECT name FROM tb\_character") do  
 local text = row.name  
 local t = display.newImage("Images/character/"..text..".png")  
end  

I wanna insert the “t” into localGroup because i wanna clean it when my application changed to another scene.
but everytime i inserted it, my application gets error
"Copyright…
done – just notification that database created successfully
Runtime error
C:\User…\map.lua:146:ERROR:table expected.
If this is a function call, you might have used “.” instead of ":"
stack traceback:
[C]:?
[C]: in function ‘insert’
C:\Users…\map.lua:14 [import]uid: 33180 topic_id: 7902 reply_id: 307902[/import]

we need to see your other code [import]uid: 6645 topic_id: 7902 reply_id: 28240[/import]

thanks for replying,jmp909

i solved the problem

first i insert data that i wanna call to database

[code]

------------------------------ button function --------------------------------

local function btnMomo()
db:exec [[INSERT INTO tb_character VALUES (1, “momo”)]]
print(“momo selected”)
director:changeScene(“loading”, “crossfade”)
end

local function btnMimi()
db:exec [[INSERT INTO tb_character VALUES (1, “mimi”)]]
print(“mimi selected”)
director:changeScene(“loading”, “crossfade”)
end

local function btnChichi()
db:exec [[INSERT INTO tb_character VALUES (1, “chi-chi”)]]
print(“chi-chi selected”)
director:changeScene(“loading”, “crossfade”)
end

local function btnChocho()
db:exec [[INSERT INTO tb_character VALUES (1, “cho-cho”)]]
print(“cho-cho selected”)
director:changeScene(“loading”, “crossfade”)
end


----------------------------------- button ------------------------------------

local MomoBtn = menuUI.newButtonMenu{
default = “Images/character/momo btn.png”,
over = “Images/character/over.png”,
onRelease = btnMomo,
x = 65,
y = display.contentHeight/2
}
MomoBtn:scale(0.7, 0.7)

local MimiBtn = menuUI.newButtonMenu{
default = “Images/character/mimi btn.png”,
over = “Images/character/over.png”,
onRelease = btnMimi,
x = 192,
y = display.contentHeight/2,
}
MimiBtn:scale(0.7, 0.7)

local ChichiBtn = menuUI.newButtonMenu{
default = “Images/character/chi-chi btn.png”,
over = “Images/character/over.png”,
onRelease = btnChichi,
x = 319,
y = display.contentHeight/2+1,
}
ChichiBtn:scale(0.7, 0.7)

local ChochoBtn = menuUI.newButtonMenu{
default = “Images/character/cho-cho btn.png”,
over = “Images/character/over.png”,
onRelease = btnChocho,
x = 445,
y = display.contentHeight/2,
}
ChochoBtn:scale(0.7, 0.7)

then in other file .lua, i call it…first i made it as global variable then i change it to local variable so i can manipulate then like what i want

[code]
require “sqlite3”
local dbPath = system.pathForFile (“database.sqlite”, system.DocumentsDirectory)
local db = sqlite3.open(dbPath)

–load character
for row in db:nrows(“SELECT * FROM tb_character”) do
local text = row.name
t = “Images/character/”…text…".png"
end

local character = display.newImage(t) --this variable that i use to animate
[import]uid: 33180 topic_id: 7902 reply_id: 28336[/import]