Welcome Guest, Not a member yet? Register   Sign In
Active Record and Protect Identifiers
#1

[eluser]davetao[/eluser]
Hello guys,

My team and I have come across this very peculiar problem related to escaped query parameters

Here is the test case;

$this->db->select('mytitle', FALSE)->get('mytable');
$this->db->select('order')->get('mytable');
# creates the error because 'order' is not escaped automatically.

Looking at the active record code, i have found this...

function select($select = '*', $escape = NULL)
{
// Set the global value if this was sepecified
if (is_bool($escape))
{
$this->_protect_identifiers = $escape;
}
...

My question is this, is this feature a part of the codeigniter design or is it a bug because our assumption as developers, setting the $escape = FALSE should only run for that query, rather than for the entire page request.

Our solution was to RESET the protect_identifiers = TRUE after each query


Messages In This Thread
Active Record and Protect Identifiers - by El Forum - 09-09-2010, 02:35 AM
Active Record and Protect Identifiers - by El Forum - 09-12-2012, 12:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB