I am getting nil value when I tried to update the data for below code :
local update_statement =db:prepare[[ UPDATE list SET :name :icon WHERE :id]]
update_statement:bind_names{ name = aName, 开发者_StackOverflow中文版 icon = aIcon, id = aId }
update_statement:step()
update_statement:reset()
And also I need the syntax for delete operation in lua program.
Please help me
Thank you, Madan mohan.
You need to learn SQL's syntax.
Basically, you're not telling which columns you want to update, you're only giving their values.
local update_statement = db:prepare[[ UPDATE list SET name = :name, icon = :icon WHERE id = :id]]
Here's the syntax for the DELETE statement:
local delete_statement = db:prepare[[ DELETE FROM list WHERE id = :id]]
精彩评论