diff --git a/libraries/Datatable.php b/libraries/Datatable.php index d7f2363..643bffd 100644 --- a/libraries/Datatable.php +++ b/libraries/Datatable.php @@ -402,14 +402,10 @@ private function sqlJoinsAndWhere() $globSearch = $f->post_get('search'); if ($globSearch['value'] !== '') { $gSearchVal = $globSearch['value']; - $sqlOr = ''; - $op = ''; foreach ($searchableColumns as $c) { - $sqlOr .= $op . $c . ' LIKE \'' . $this->CI->db->escape_like_str($gSearchVal) . '%\''; - $op = ' OR '; + $searchType = $this->getColumnSearchType($c); + $this->CI->db->or_like($c, $gSearchVal, $searchType); } - - $this->CI->db->where('(' . $sqlOr . ')'); }