• mindwhirl

    (@mindwhirl)


    I created a small table with the plugin that searches employees in a college. Here’s an example record:

    First Name Last Name Title Phone Email Office Campus Department //
    Shawn Adams Associate VP of Evening, Weekend and Online Programs 404.555.5555 [email protected] C1111 Academic Building Main Academic Affairs

    When I search for VP, Weekend, Affairs, or [email protected] nothing is returned. “No Result.”

    When I search Shawn, Adams, Associate, Academic, or C1111 the record is returned.

    The difference is: searching the first word in a cell returns the result. Searching the second, or higher words in the cell does not return a result.

    Whats going on? Do I need to change the select statement in the code?

    Thanks in advance for all your help and thanks for developing the plugin!

Viewing 1 replies (of 1 total)
  • Thread Starter mindwhirl

    (@mindwhirl)

    OK, nevermind. I saw a couple other posts and realized I could change the query on lines 1442 and 1528.

    I changed it from:
    $results_sql = "SELECT id,field_id,field_input FROM " . $table . " WHERE field_input COLLATE UTF8_GENERAL_CI LIKE '" . $_POST['sds-search-data'] . "%' ORDER BY id ASC";

    to

    $results_sql = "SELECT id,field_id,field_input FROM " . $table . " WHERE field_input COLLATE UTF8_GENERAL_CI LIKE '%" . $_POST['sds-search-data'] . "%' ORDER BY id ASC";

    The difference is a %.

    [Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]

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