我使用where_in通过传递数组从数据库中检索记录,但它不起作用

时间:2018-04-03 10:44:12

标签: php mysql codeigniter

下面的函数用于获取受尊重用户的邮件ID

function getMomMailId($data){
    $this->db->select('email');
    $this->db->from('tbl_users');
    //I used where_in, and compared the array of user ids with ids in another table 
    $this->db->where_in('userId',$data['toid']);
    $query = $this->db->get();
    $result=$query->result_array();
    return($result);
}

对于两个记录,它从数据库表中提供了所有电子邮件ID。并且数组中有两个记录。它应该只有两个电子邮件ID。

0 个答案:

没有答案