Welcome Guest, Not a member yet? Register   Sign In
Backticks not added when using custom operator (v1.6.2)
#1

[eluser]Unknown[/eluser]
in my code (where CI is a codeigniter instance)

$this->CI->db->where("left >", (int)$record[$this->left_column]);

produces: ...WHERE left > 11...

$this->CI->db->where("left", (int)$record[$this->left_column]);

produces: ...WHERE `left` = 11...

In the former case, where I am using a custom operator the backticks are not produced and I have to insert them myself. This seems to be fairly inconsistent and inconvenient. Please consider fixing this.

Suggested fix:
change line 444 in DB_active_rec.php from
$k = preg_replace("/([A-Za-z_0-9]+)/", $this->_protect_identifiers('$1'), $k);
to
$k = preg_replace("/([A-Za-z_0-9]+)/e", '$this->_protect_identifiers("\\1")', $k);


Messages In This Thread
Backticks not added when using custom operator (v1.6.2) - by El Forum - 06-05-2008, 07:56 PM
Backticks not added when using custom operator (v1.6.2) - by El Forum - 06-10-2008, 08:39 AM
Backticks not added when using custom operator (v1.6.2) - by El Forum - 06-11-2008, 02:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB