CodeIgniter Active Record Where Not In String -


i'm having issue ci active record's "where not in". trying exclude series of id's. couldn't understand why worked fine , dandy one record, not multiple.

my query

$this->db->where_not_in('crm.user_id', $ignore); 

the problem when profile the query wrong.

with string of id's

// $ignore = "12,13";     select * (`crm`) `crm`.`user_id` not in ('16,13')  , `survey` =  1  

with string of quotes id's

// $ignore = "'12','13'"; select * (`crm`) `crm`.`user_id` not in ('\'16\',\'13\'')  , `survey` =  1  

am forced loop of "or_where_not_in" or that?

where_in , where_not_in expect pass array, not string 2nd parameter.

$ignore = array(12, 13);  $this->db->where_not_in('crm.user_id', $ignore); 

link docs: http://www.codeigniter.com/userguide2/database/active_record.html


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -