Welcome Guest, Not a member yet? Register   Sign In
Searching multiple tables - fields
#1

(This post was last modified: 10-16-2019, 04:05 AM by demyr.)

Hi there, 

I need the logic behind multiple field search. 

So far I have tried group_start() or_group_start() for nested search but did not have any proper result. 

Let me explain shortly what my problem is:
I have got 2 dropdown selects and 1 input. So, there must be 2 scenarios :

The first scenario - the search without input, which is for company name :

a) results based on city only (one of the selects) 
b) results based on category only (the other select) 
c) results based on city and category together

The second scenario - the search with input (name of company) :

a) results based on name only
b) only city
c) only category
d) city and category together
e) city and name match
f) category and name
e) all of them chosen together

I also tried creating multiple if, elseif on controller but it didn't seem so wise. I guess, It is only OK for 
if(empty($name)) { bla bla} // just to check an empty input I mean.

To sum up, Is trying group_start() correct? I need you to show me the route. Then I will try.

P.S : city, category and name are 3 different tables in my database.
Reply


Messages In This Thread
Searching multiple tables - fields - by demyr - 10-16-2019, 02:41 AM
RE: Searching multiple tables - fields - by demyr - 10-16-2019, 01:24 PM
RE: Searching multiple tables - fields - by demyr - 10-20-2019, 11:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB