[eluser]jedd[/eluser]
Much nicer!
In general, we try to avoid calling $post data from the model - the model should just get data, and send data, and not really have any idea about the origins of that data, or how it will be displayed, etc.
So, in your controller you could do this:
Code:
if ( $this->User_model->checkUserLogin ($this->input->post('username') , $this->input->post('password')) ) {
...
And in your model:
Code:
function checkUserLogin ( $user = NULL , $pass = NULL )
{
$query=$this->db->where("username", $user);
$query=$this->db->where("password", $pass);
$query=$this->db->limit(1,0); // I'd drop this line
$query=$this->db->get('users');
if ($query->num_rows() == 1)
return TRUE;
else
return FALSE;
}