CodeIgniter Forums
CI 1.6.1 -> DB_active_rec.php -> TRUE instead of FALSE in function "or_where_not_in" - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: CI 1.6.1 -> DB_active_rec.php -> TRUE instead of FALSE in function "or_where_not_in" (/thread-6494.html)



CI 1.6.1 -> DB_active_rec.php -> TRUE instead of FALSE in function "or_where_not_in" - El Forum - 03-01-2008

[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


CI 1.6.1 -> DB_active_rec.php -> TRUE instead of FALSE in function "or_where_not_in" - El Forum - 03-02-2008

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


CI 1.6.1 -> DB_active_rec.php -> TRUE instead of FALSE in function "or_where_not_in" - El Forum - 03-02-2008

[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)



CI 1.6.1 -> DB_active_rec.php -> TRUE instead of FALSE in function "or_where_not_in" - El Forum - 03-03-2008

[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.


CI 1.6.1 -> DB_active_rec.php -> TRUE instead of FALSE in function "or_where_not_in" - El Forum - 03-03-2008

[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/