$this->db->where('id',$id) 当where参数值$id是一个数组时,怎么查
现在有一个数组$id,里面有几个客户的id,我要根据这个数组里面的id分别查询出客户的name$this->db->select('username');
$this->db->where('id',$id);
$query=$this->db->get('c_member');
return $query->result_array();
希望得到这些用户的用户名,麻烦各位大神帮帮忙
这样写:
$this->db->select('username');
$this->db->where_in('id',$id);
$query=$this->db->get('c_member');
return $query->result_array(); 谢谢 试了 可以的 {:soso_e113:}
页:
[1]