I will like to thank you, Rob for all help you have done for me
Everything is working nicely now. Here´s the trick from your code that helped me out
[LUA]
function functionSqlView()
local sql = nil
tableView:deleteAllRows()
local counter = 1
local res = {}
– NOW WE BUILD THE SQL QUERY IN A FORLOOP FROM THE mySqlView TABLE, INSERTED FROM THE SUBBUTTONS VALUES
sql = "SELECT * FROM birds WHERE "
for k, v in ipairs(mySqlView) do
sql = sql … v … " "
if counter < #mySqlView then
sql = sql … " AND "
end
counter = counter + 1
end
dbTable = {} – START WITH A FRESH TABLE
count = 0 – AND FRESH COUNTER
– PREPARE THE ROWS SELLECTION BASED ON THE DATABASE ROWS THROUGH THE SQL QUERY
for row in db:nrows( sql ) do
count = count +1
dbTable[count]={}
dbTable[count].NAME = row.NAME
dbTable[count].LATIN = row.LATIN
dbTable[count].INFO = row.INFO
end
– STYLING FOR THE ROWS ON SCREEN
for i = 1, #dbTable do
local isCategory = false
local rowHeight = 95
local rowColor = {
default = { colorConverter(114, 72, 30, 0) },
}
local lineColor = { colorConverter(20, 20, 0, 0) }
– Insert the row into the tableView
tableView:insertRow
{
rowHeight = rowHeight,
rowColor = rowColor,
lineColor = lineColor,
}
end
return true
end
[/LUA]
Again, thanx a lot Rob