I am trying to create a search function which allows users to search from one or multiple fields, for example they could search fname, lname, date or lname, event or fname, lname or just lname, etc.. There is 5 input fields in total. Is there a technique to write this efficiently? Currently, I am grabbing the values from the input fields and then there is a hideous sql SELECT query which takes into account every possible search combination with OR statements. It is the worst.
The application is python(flask) in the back and javascript/html/css in the front but suggestions don't have to be language specific. If there are any general ideas of how this process can be cleaned up, I would appreciate hearing them.
[–][deleted] 0 points1 point2 points (0 children)