Welcome Guest, Not a member yet? Register   Sign In
[SOLUTION] Problem in OCI8 DB driver
#2

[eluser]Kobus M[/eluser]
The entire changed function now looks like this:


Code:
/**
     * Escape String
     *
     * @access  public
     * @param   string
     * @param    bool    whether or not the string will be used in a LIKE condition
     * @return  string
     */
    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
[SOLUTION] Problem in OCI8 DB driver - by El Forum - 02-03-2011, 07:04 AM
[SOLUTION] Problem in OCI8 DB driver - by El Forum - 02-03-2011, 07:06 AM
[SOLUTION] Problem in OCI8 DB driver - by El Forum - 02-17-2011, 01:39 PM
[SOLUTION] Problem in OCI8 DB driver - by El Forum - 02-20-2011, 09:50 PM
[SOLUTION] Problem in OCI8 DB driver - by El Forum - 02-21-2011, 09:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB