I have the problem, that the following if
condition always goes into the first if
condition, never into the elseif
condition.
This is my code below :
if ($this->session->has_userdata('role') == 1) {
$this->session->set_flashdata('success', 'Welcome ' . $userInfo[0]->name . '!');
redirect('adashboard');
} elseif ($this->session->has_userdata('role') == 2) {
$this->session->set_flashdata('success', 'Welcome ' . $userInfo[0]->name . '!');
redirect('udashboard');
}
Can you tell my why?