|
In the code snippet:
local insert_stmt = db:prepare('SELECT * FROM numbers') -- WHERE num1=1')
x = insert_stmt:get_names()
print(x[3])
if sqlite3.ROW == insert_stmt:step() then
x = insert_stmt:get_values()
end
:get_names() works because the first iteration returns the column names. :step() then iterates to the first row of values so now :get_values works. Correct?