Login with email or username in codeigniter
function login_user()
{
$email= $this->input->post('email');
$password= MD5($this->input->post('password'));
$this->db->where("(Email='$email' OR Username='$email') AND Password='$password' ");
$Query = $this->db->get('users');
if($Query->num_rows() > 0)
{
return $Query->row();
}
else
{
return false;
}
}
Comments
Post a Comment