Welcome Guest, Not a member yet? Register   Sign In
$this->db->escape() - Fix.
#1

[eluser]barryskidmore[/eluser]
All:

$this->db->escape() has issues dealing with common databases functions such as

update table set quantity=quantity+1

Or

update table set updatetime=NOW()

So I modified the function slightly "DB_driver.php" line 687

Code:
/**
     * "Smart" Escape String
     *
     * Escapes data based on type
     * Sets boolean and null types
     *
     * @access    public
     * @param    string
     * @return    integer        
     */    
    function escape($str)
    {    
        if (is_numeric($str) === false && stristr($str,'NOW()') === false) {
            $str = $str = "'".$this->escape_str($str)."'";
        }

        return $str;
    }


Messages In This Thread
$this->db->escape() - Fix. - by El Forum - 09-22-2008, 12:46 PM
$this->db->escape() - Fix. - by El Forum - 09-22-2008, 01:16 PM
$this->db->escape() - Fix. - by El Forum - 09-22-2008, 01:24 PM
$this->db->escape() - Fix. - by El Forum - 09-22-2008, 01:34 PM
$this->db->escape() - Fix. - by El Forum - 09-22-2008, 02:52 PM
$this->db->escape() - Fix. - by El Forum - 09-22-2008, 03:07 PM
$this->db->escape() - Fix. - by El Forum - 11-13-2008, 10:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB