Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not Use mysql reserve words as column name in where condition [solution] #70

Open
umefarooq opened this issue Sep 30, 2014 · 0 comments

Comments

@umefarooq
Copy link

Hi, found one bug we can not use mysql reserve words as columns in where condition with Ignited Datatables as you are using simple string as where or condition and i used key as column name

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

to avoid this problem and use mysql reserve words as column name use the following CI database function $this->ci->db->_protect_identifiers($col_name)

$this->ci->db->_protect_identifiers($this->select[$mColArray[$i]])

$sWhere .= $this->ci->db->_protect_identifiers($this->select[$mColArray[$i]['data']]) . " LIKE '%" . $sSearch . "%' OR "; line no 298

$sWhere .= $this->ci->db->_protect_identifiers($this->select[$mColArray[$i]]) . " LIKE '%" . $sSearch . "%' OR "; line no 300 in your current library

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

No branches or pull requests

1 participant