CodeIgniter Forums

Full Version: CI 1.6.1 -> DB_active_rec.php -> TRUE instead of FALSE in function "or_where_not_in"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
hye,
i am not english. So, sorry for my poor english language.

The bug is localized in the file DB_active_rec.php at line 540

Code:
function or_where_not_in($key = NULL, $values = NULL)
{        
   return $this->_where_in($key, $values, FALSE, 'OR ');
}

The correction is :
Code:
function or_where_not_in($key = NULL, $values = NULL)
{        
    return $this->_where_in($key, $values, TRUE, 'OR ');
}

Best regards

El Forum

[eluser]Derek Allard[/eluser]
Could you explain a bit more about why you feel this is incorrect jchouix?

El Forum

[eluser]Seppo[/eluser]
Hey Derek,
I also think it's a bug... The third parameter is $not and described as "If the statement whould be IN or NOT IN", and right now or_where_not_in does exactly the same thing as or_where_in and you can test it

Code:
$this->db->where('field', 'value');
        $this->db->or_where_not_in('a', array(1,2,3));
        echo $this->db->_compile_select();
// Produces
// SELECT * WHERE `field` = 'value' OR `a` IN (1, 2, 3)
// and should produce
// SELECT * WHERE `field` = 'value' OR `a` NOT IN (1, 2, 3)

El Forum

[eluser]Derek Allard[/eluser]
Cool, if you feel its a bug, could I trouble you to file a bug report? Sorry, but I'm head-deep in development for SxSW this weekend, and I won't get to this before then. Thanks.

El Forum

[eluser]Seppo[/eluser]
Already done =) I can see you are too busy with SxSW =P

-Edit- I put the link: http://codeigniter.com/bug_tracker/bug/4171/