Hi,
Hope someone can help with this very frustrating problem.
I have an SQLLite database with 5 columns, and 11 rows of data. I am trying to create a function that queries all the data, according to my selected criteria. This part is easy. The hard part is filtering each column individually, and getting a very narrow search result. For example, I have a list of diamonds, each diamond has a different Shape, carat, cut, color, clarity and Price (columns). I am trying to create a filter whereby a user can select different filtering criteria and the tableView list populates with the filtered results. Kind of like a filtering panel on an ecommerce website to try and narrow search results for a product.
My code logic so far is the following:
When the user taps a filtering option:
-
Delete all rows of the tableView
-
Add that filtering keyword to an array
-
Loop through that array
-
retrieve my data: -----> for row in db:nrows( [[SELECT * FROM test WHERE ‘]]…criteria…[[’ LIKE ‘%]]…query…[[%’]]) do
-
inserts filtered row.
Problem I am having is that this only filters a particular item one at a time. I need to keep boiling down the results to a refined set of results and I am not sure how to do this.
Any help would be greatly appreciated!
Thanks!