Change your TRUE
and FALSE
as well check in controller:
In Model
public function unique_email($email)
{
$this->db->select('*');
$this->db->from('instructor');
$this->db->join('student', 'instructor.email = student.email');
$this->db->where('instructor.email',$email);
$query = $this->db->get();
if ($query->num_rows() > 0)
{
# email exist
return false;
}
else {
# new/fresh email
return true;
}
}
Controller :
function email_exists($email) {
$result = $this->Register_model->unique_email($email);
if ($result == TRUE) {
echo "Email Exists";
} else {
echo "New Email";
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…