Welcome Guest, Not a member yet? Register   Sign In
Bug in Active Record
#1

[eluser]Wades[/eluser]
this bug happens when we custom key/value method:

normally, if we use
Code:
$this->db->where('name !=', $name);
then we will get
Code:
// Produces: WHERE name != 'Joe'

but if we use
Code:
$this->db->where('name!=', $name);
(without space between name and !=)
we will get
Code:
// Produces: WHERE 'name!=''Joe'
#2

[eluser]xwero[/eluser]
I don't think it's a bug, it's a convention to separate the 'weird' fieldnames from the operator.
Code:
function _has_operator($str)
    {
        $str = trim($str);
        if ( ! preg_match("/(\s|<|>|!|=|is null|is not null)/i", $str))
        {
            return FALSE;
        }

        return TRUE;
    }




Theme © iAndrew 2016 - Forum software by © MyBB