CodeIgniter Active Record Where Not In String

前端 未结 1 719
悲&欢浪女
悲&欢浪女 2021-01-17 11:16

I\'m having an issue with CI Active Record\'s \"Where Not In\". I am trying to exclude a series of ID\'s. I couldn\'t understand why everything worked fine

相关标签:
1条回答
  • 2021-01-17 11:46

    where_in and where_not_in expect you to pass an array, not a string as the 2nd parameter.

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

    Link to the docs: http://www.codeigniter.com/userguide2/database/active_record.html

    0 讨论(0)
提交回复
热议问题