<?php
Class User extends CI_Model
{
 function login($username, $password)
 {
   $this -> db -> select('u_id, u_name, u_password');
   $this -> db -> from('user');
   $this -> db -> where('u_name', $username);
   $this -> db -> where('u_password', $password);
   $this -> db -> limit(1);

   $query = $this -> db -> get();

   if($query -> num_rows() == 1)
   {
     return $query->result();
   }
   else
   {
     return false;
   }
 }
}
?>