if($c_type=='Telephone_Counseling')
{
$qry="SELECT eemp_id,email FROM book_tele_counseling_mstr WHERE CaseId='" . $cid . "'";
$query=$this->db->query($qry);
// return $query->result();
foreach($query->result() as $row)
{
$eemp_id=$row->eemp_id;
$email=$row->email;
}
$this->email->initialize($this->config);
$message_str = 'Your session is closed';
$this->email->from('[email protected]', 'Santulan Suport Team');
$this->email->to($email);
$this->email->subject("This is mail from counselor");
$this->email->message($message_str);
$this->email->send();
}
在上面的代碼我應該得到上面的查詢結果,但同時我調試的代碼foreach循環無法正常工作
檢查查詢是否被讀取多條記錄。 – Amit
不僅對單個收件人的表格 –
是$ cid填充的情況下,$ query-> num_rows()返回什麼,我會說0,因此沒有結果獲取槽 – Xavjer