-1
控制器代碼
如何檢查電子郵件已經存在於多個表中笨如何檢查電子郵件在多個表中笨已經存在
function rolekey_exists($key) {
$this->Register_model->mail_exists($key);
}
型號代碼
下方所示型號代碼我加入了兩張表如何在插入兩張不同的表之前查看郵件已存在
function mail_exists($key)
{
$this->db->select('*');
$this->db->from('supplier_registration');
$this->db->join('customer_registration', 'supplier_registration.email = customer_registration.email');
$this->db->where('supplier_registration.email',$key);
$query=$this->db->get();
if ($query->num_rows() > 0){
return true;
}
else {
return false;
}
}
沒有得到你的意思 –
之前插入新的電子郵件到數據庫表我需要檢查電子郵件存在或不在兩個不同的表 – Learner
亞所以在我的代碼它可以存檔,在控制器'回聲「新電子郵件」;'刪除此並添加插入功能 –