You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it looks like there is some issue with the like function in db library: ("concat(users.name, ' ', IF(users.surname IS NULL or users.surname = '', '', users.surname)) full_name") works in the select statement but fails in the like function.
It produces this: OR concat(users.name, ' ', IF(users.surname IS NULL or users.surname= '', '', users.surname)) LIKE :concat(users.name, ' ', IF(users.surname IS NULL orusers.surname = '', '', users.surname)): ESCAPE '!'
This simple code will result into error:
functionsqlTest(){
$search['value'] = 'perfect';
$usersModel = new \App\Models\Users_model();
$usersModel
->select("concat(users.name, ' ', IF(users.surname IS NULL or users.surname = '', '', users.surname)) full_name")
->groupStart()
->orLike("users.email", $search['value'], 'both')
->orLike("users.phone", $search['value'], 'both')
->orLike("concat(users.name, ' ', IF(users.surname IS NULL or users.surname = '', '', users.surname))", $search['value'], 'both')
->groupEnd()
->findAll();
echo$usersModel->getLastQuery();
}
The text was updated successfully, but these errors were encountered:
mmfarhan
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
Dec 7, 2020
mmfarhan
changed the title
Bug:
Bug: Like function of Database library fails when used with Concat
Dec 7, 2020
kenjis
changed the title
Bug: Like function of Database library fails when used with Concat
Bug: [QueryBuilder] Like function of Database library fails when used with Concat
Mar 21, 2022
Hi,
it looks like there is some issue with the like function in db library:
("concat(users.name, ' ', IF(users.surname IS NULL or users.surname = '', '', users.surname)) full_name")
works in the select statement but fails in the like function.It produces this:
OR concat(users.name, ' ', IF(users.surname IS NULL or
users.
surname= '', '', users.surname)) LIKE :concat(users.name, ' ', IF(users.surname IS NULL or
users.
surname= '', '', users.surname)): ESCAPE '!'
This simple code will result into error:
The text was updated successfully, but these errors were encountered: