I am hoping to get some help from the SitePoint community on a PHP challenge I am trying to get going.
I need to build a search functionality, so users can select many parameters, and then run a query across many tables to get their results.
Our website allows users to see new homes being built around the city, filtered by the area of the city, and the type (single or multi family) they are most interested in.
Here are my tables:
Quadrant
ID
Name
Abbreviation
Home Builder
ID
Name
Website
Type (single or multi)
I have seen quite a few threads dealing with this issue, and you might find them using the term “query builder” - there could be other terms, but this ought to give you a start.
If you do not use PDO already, then that is also a good candidate for automating the filtering of incoming variable in such a query builder.
When it comes to doing joins however this can get fiddly, you might get some ideas by looking at how an ORM works, Doctrine is one example of an ORM.