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

c# - passing input text from view to contoller with FacebookContext using Facebook app -

ios - Does Core Data autoupdate a many to many relationship on saving -

Calling a C++ function from C# by passing a string with variable size to it -