Welcome Guest, Not a member yet? Register   Sign In
Easy way to check existence of a user in DB ? ( Newbie )
#2

[eluser]Dam1an[/eluser]
The easiest way is something like
Code:
$this->db->where('username', $username);
$this->db->where('password', $password);
$query = $this->db->get('users');
if($query->num_rows() == 1) {
  // Username and password match
} else {
  // Error
}

You might need to chance variable names of the columns/table


Messages In This Thread
Easy way to check existence of a user in DB ? ( Newbie ) - by El Forum - 05-06-2009, 08:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB