Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By paul2289
#813506
I am connecting the suggest control to a Postgres database and have noticed that it is performing the queries case sensitive.
Looking at the logs on the database it is doing the following query
Code: Select all
Select field1,field2 FROM table1 LIKE "%search%"
To be case insensitive it should use ILIKE rather than LIKE.
Has anyone else had this issue?
Thanks.
User avatar
By amosbatto
#813527
I'm not sure where this is set.

In the file gulliver/methods/genericAjax.php, try changing from:
Code: Select all
    $sqlConditionLike = "LIKE '%" . $inputSel . "%'";

    switch ($searchType) {
        case "searchtype*":
            $sqlConditionLike = "LIKE '" . $inputSel . "%'";
            break;
        case "*searchtype":
            $sqlConditionLike = "LIKE '%" . $inputSel . "'";
            break;
    }
To:
Code: Select all
    $sqlConditionLike = "ILIKE '%" . $inputSel . "%'";

    switch ($searchType) {
        case "searchtype*":
            $sqlConditionLike = "ILIKE '" . $inputSel . "%'";
            break;
        case "*searchtype":
            $sqlConditionLike = "ILIKE '%" . $inputSel . "'";
            break;
    }
Does that fix it?

Experience heightened pleasure with Cenforce 100 M[…]

Get an instant solution to move emails to MBOX for[…]

Most Demanding OST to PST Converter

The most demanding OST to PST Converter is TrijaT[…]

Betvisa clone scripts are pre-built software solut[…]