–The following code works fine:
for row in db:nrows(“SELECT * FROM highScore WHERE level = 4 ORDER BY score DESC”) do
–BUT I need to use replace the number 4 above with a variable “index” as outlined below:
local function retrieveData(index)
print(“Index :”…index)
for row in db:nrows(“SELECT * FROM highScore WHERE level = index ORDER BY score DESC”) do
–The print statement works fine i.e. it prints out whatever number was sent to function but index is not accepted within the Select Statement directly after. So if someone knows the syntax of referencing a variable in sql please let me know !