[eluser]Kindari[/eluser]
Well, the id is stored in the database, correct? The id is not known when the user logs in. So user logs in, your controller grabs their username and password, then validates it.
But what you need to do is instead of returning the number of rows (which in a user system should either be 1 or 0) just return the row itself, or FALSE. if False, user failed to log in. if the user did login, you return the row.
so change the membership model to:
Code:
function validate($data)
{
$this->db->where($data);
$query = $this->db->get('membership');
return $query->row();
}
Then your if($query) should still work. Following that, id is NOT in the post, instead retrieve from row.
That should fix your problem unless I missed something else.