Hi, I have been having a difficult time figuring out how to delete rows from a database. I’ve looked at other posts for an answer and cannot find one.
Here is a sample of code:
–delete all the table contents
local n = 1
for row in db:nrows(“SELECT * FROM test”) do
local tableDelete = [[DELETE FROM test WHERE id == row]]
db:exec(tableDelete)
end
This does not delete my rows.
Also, how do I delete a database file entirely, when it is no longer needed?
I want to use a database in sql for saving number of objects and position of those objects. The number of objects changes from game to game. Any help or advise would be greatly appreciated! I’ve looked at some other lua based sql tutorials but the code samples they give dont seem to work in Corona.
Anyway, Thanks for your help in advanced!!!
Bodee [import]uid: 15607 topic_id: 8196 reply_id: 308196[/import]