Hello,
I have to make query that search over 3 tables in my DB. Il make a example:
I get request via URL from my front-end search form something like this:
/cars/search/{condition}/{type}/{location}
DB name:
- cars
DB tables:
- cars
- cars_types
- cars_locations
Now, if i get request something like this: /cars/search/new/BMW/NewYork Result is: Give me all cars wich are in new condition, type is BMW, from location New York.
But, if i get request something like this: /cars/search/all/all/NewYork
Results must be: Give me cars with any conditions, any types from specific location = NewYork.
How to make this "all" parameter default (so when i recive all in parameter, that must meen give me all from that table), and what is the best way to retrive this data..