Welcome Guest, Not a member yet? Register   Sign In
Sql Query Like by Multiple columns
(This post was last modified: 11-11-2022, 07:31 PM by UchihaSV.)

Hello, i use SQL QB and it's fine, but i need use more flexible - need find data by one string but in multiple concat columns (first_name, last_name, patronymic).
For example i need find string "Mark Suckerberg" in first_name + last_name columns (without OR, AND) - need generate sql part as "where (first_name + last_name) like '%string%'", but SQL QB like, orLike generated extra escaping and it's not work correctly:
PHP Code:
if (isset(
$_GET['search'])) {
  $this->userModel->orLike('(last_name + first_name + patronymic)'$_GET['search']);
$this->data->users $this->userModel->orderBy('id','desc')->withDeleted()->paginate(25); 

Any suggestion?

Messages In This Thread
Sql Query Like by Multiple columns - by UchihaSV - 11-11-2022, 07:26 PM

Theme © iAndrew 2016 - Forum software by © MyBB