stmt:rows

Creates an iterator that returns a table of rows from a SELECT - numerically keyed

Prototype

stmt:rows()

Description

Returns an function that iterates over the values of the result set of statement stmt. Each iteration returns an array with the values for the current row. This is the prepared statement equivalent of db:rows().


Note: You should let the iterator finish (that is, get to the end of the selected rows) otherwise the database remains locked. So, do not "break" out of the for loop.

Lua functions

Topics