Filters with PHP priority

0

Hello,

In many web platforms, I see that there are forms, search systems, etc., where the user needs to be obligatorily, to mark some elements, be they dropdowns, checkboxes, radio buttons, but in some of them, regardless of whether they are empty or no, the system still filters and returns what you wanted because some do not require padding.

My curiosity is to know how the backend is normally done under these circumstances. How is select done within the bank? Because the only way I imagine it would be a string of ifs or switches with PHP.

Thank you.

    
asked by anonymous 03.01.2017 / 14:15

1 answer

0

If I understand correctly, one of the ways to do this is to mount the query in PHP, store it in a string and then execute. The query can be set up using text substitution . So you can add or remove elements without breaking the SQL syntax.

    
03.01.2017 / 14:30