[eluser]Dam1an[/eluser]
Try this
Code:
function process_login() {
$username = $this->input->post("username");
$password = $this->input->post("password");
$this->db->where('username', $username);
$this->db->where('password', $password);
$query = $this->db->get('members');
if($query->num_rows() == 1) {
$data = array('username'=>$username,'logged_in'=>true);
$this->session->set_userdata($data);
redirect('dashboard');
} else{
$this->session->set_flashdata('message','<div id="message">you have entered the wrong details</div>');
redirect('login/index');
}
}
All I've done, is broken the where and get into seperate clauses (personal preference)
And checked if that returns a single row, if it does, log them in as normal, else, redirect to login