Pass array to where in Codeigniter Active Record

前端 未结 4 1866
傲寒
傲寒 2020-12-05 22:50

I have a table in my database with adminId and clientId

There might be 20 records with the adminId of the logged in user and I\'m trying to pull a list of clients.

4条回答
  •  时光说笑
    2020-12-05 23:53

    Use where_in()

    $ids = array('20', '15', '22', '46', '86');
    $this->db->where_in('id', $ids );
    

提交回复
热议问题