• Roger Sparks

    (@rogersparksvisualmecom)


    Hi,

    We love this plug-in.

    It would be great addition to have the search form capability optionally use LIKES instead of “=” for determine search results with a setting. This would give the ability to do wildcard matches for search results – e.g. entering “roger” in one field would return any record with something in that column LIKE ‘%roger%’. Even better would be just the ability to enter the search as ‘%roger%’ or ‘%roger’ or ‘roger%’ and have the SQL generate a LIKE instead of an “=” for the search.

    Thanks… Roger

Viewing 1 replies (of 1 total)
  • arete7

    (@arete7)

    Hi,

    You can, just append a ‘%’ at the end of your field/column that you are searching.
    eg [abase form="1,search" table="employees" columns="first_name%,last_name%$Search Employees" elements="first_name,last_name"]
    This will match ‘Bob’ in Bobby.

    More complex LIKE searches need a little more defining.
    eg [abase form="1,search" table="employees" columns="first_name!'text '=%first_name%,last_name!'text '=%last_name%$Search Employees" elements="first_name,last_name"]
    What this is doing is defining the input form type and telling the form surrogate to compare to, being itself.
    So the search LIKE is omnidirectional, ie ‘ob’ will match bobby, obby, snobby, etc….

    HTH
    Paul

    • This reply was modified 8 years ago by arete7.
Viewing 1 replies (of 1 total)
  • The topic ‘Search LIKE instead of =’ is closed to new replies.