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?
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]