Welcome Guest, Not a member yet? Register   Sign In
escape not working with active record and Oracle
#4

[eluser]Unknown[/eluser]
I found another way of handeling the escaped problem in oracle.

Within the system -> database -> drivers -> oci8 -> oci8_driver.php
have added this line:
Code:
$str = str_replace("'", "''", $str);
in the escape_str function
Code:
function escape_str($str, $like = FALSE)
    {
        if (is_array($str))
        {
            foreach($str as $key => $val)
            {
                $str[$key] = $this->escape_str($val, $like);
            }

            return $str;
        }

        $str = remove_invisible_characters($str);
        $str = str_replace("'", "''", $str);  

        // escape LIKE condition wildcards
        if ($like === TRUE)
        {
            $str = str_replace(    array('%', '_', $this->_like_escape_chr),
                                array($this->_like_escape_chr.'%', $this->_like_escape_chr.'_', $this->_like_escape_chr.$this->_like_escape_chr),
                                $str);
        }

        return $str;
    }


Messages In This Thread
escape not working with active record and Oracle - by El Forum - 09-16-2010, 09:28 AM
escape not working with active record and Oracle - by El Forum - 01-14-2011, 09:43 AM
escape not working with active record and Oracle - by El Forum - 01-26-2011, 01:38 AM
escape not working with active record and Oracle - by El Forum - 02-03-2011, 07:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB