**CI中使用IN查詢(where_in)


注意別漏了$this->db->get();

/**
* 匹配用戶手機號,返回匹配的用戶列表
* @param $column_str 'user_id, user_name, user_avatar_src, user_mobile, user_title, user_department, user_hospital, user_audit_status '
* @param $mobile_array
*/
public function match_user_mobile($column_str, $mobile_array)
{
$this->db->select($column_str);
$this->db->from('xm_user');
$this->db->where_in('user_mobile', $mobile_array);
$query = $this->db->get();

//var_dump($query); 測試
//row_array取一行數據;result_array取多行數據
return $query->result();

}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM