Skip to content

Conversation

@briansulzen
Copy link

Search values that contain '%' or '_' will not return results. From Code Igniter guides:

The escape_like_str() method uses ‘!’ (exclamation mark) to escape special characters for LIKE conditions. Because this method escapes partial strings that you would wrap in quotes yourself, it cannot automatically add the ESCAPE '!' condition for you, and so you’ll have to manually do that.

change

$sWhere .= $this->select[$mColArray[$i]['data']] . " LIKE '%" . $sSearch . "%' OR ";

to:

$sWhere .= $this->select[$mColArray[$i]['data']] . " LIKE '%" . $sSearch . "%' ESCAPE '!' OR ";

and

$sWhere .= $this->select[$this->columns[$i]] . " LIKE '%" . $sSearch . "%' OR ";

to:

$sWhere .= $this->select[$this->columns[$i]] . " LIKE '%" . $sSearch . "%' ESCAPE '!' OR ";

chland added 10 commits October 13, 2017 13:20
First pass of cleaning up the code and make it more readable.
Renamed a bunch of variables to reflect the CI-nomenclature.

Replaced numeric array-keys with more meaningful ones to make everybodies life easier.
This basically just adds some fixes for various issues:

IgnitedDatatables#84

IgnitedDatatables#78

IgnitedDatatables#66
Added caching to check_cType to improve performance a bit.

Cleaned a few things up.
A first take on fixing the memory-leak/performance-issue when huge result-sets are queried.
Changed the way recordsTota) and recordsFiltered are calculated.
Yeah, formatting was borked due to Githubs way of using Markdown.
Modified the way get_total_results() decides which fields to use in SELECT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants