16.09.2019, 18:50
You can use ? placeholders which are replaced by additional arguments passed to getall(). This will properly escape values to prevent SQL injections when parameters come from external sources. There's also SQL BETWEEN operator which is more readable than two comparisons.
Code:
adresser = db:getall('SELECT id FROM objects WHERE id BETWEEN ? AND ?', startID, stopID)