php - sql add another searchable item -


I am trying to add another field 'Field 2' which can be searched and returned in search results.

  $ extraSQL = 'And a.' $ Db- & gt; Name quote ('field 1'). ' like ' . $ Db- & gt; Excerpt ('%'. $ 'Search'%). '';   

If I change 'field1' in 'Code 2' in the above code then Field 2 works, but I'm having trouble adding both of the above code.

Thanks

Thank you.

  $ extraSQL. = 'AND (a.' $ Db - & gt; nameQuote () 'Field 1'). 'Choice'. $ Db-> Excerpt ('%'. $ Search '%'). 'Or A'. $ Db-> Name Field ( 'Field2'). 'Choice' $ db- & quot; Quote ('%'. $ Search '%))';   

If you want to match both fields, So you want to match one of the fields, or you can change or to and .

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -