Welcome Guest, Not a member yet? Register   Sign In
MSSQL: cannot pass %1990% as query parameter - stripped by $CI->input->_remove_invisible_characters
#1

[eluser]Unknown[/eluser]
I'm querying MSSQL with code like this:

$this->db->query("SELECT ... WHERE some_field LIKE ?", array('%1990%'));

This will fail (not return the expected result) because the '%19' part of the parameter is stripped out by the call to $CI->input->_remove_invisible_characters in CI_DB_mssql_driver's escape_str method, making the final parameter value '90%'.

I get that this maybe related to the problem here: http://ellislab.com/forums/viewthread/91766/

but is there a better way to do this? maybe only remove the offending bytes and not the %nn form if used as database parameters?

Actually it seems this forum has the same problem, the previous % sign was created using % because entering the actual % sign will strip out the % sign and the following '19'.




Theme © iAndrew 2016 - Forum software by © MyBB