Welcome Guest, Not a member yet? Register   Sign In
What's better for my code below
#3

How about

PHP Code:
public function login($username$password) {
 
   if ($this->validate_password($username$password)) {
 
       $this->db->select('ud.*, u.username');
 
       $this->db->from($this->db->dbprefix 'user u');
 
       $this->db->join($this->db->dbprefix 'user_data ud''ud.user_id = u.user_id');
 
       $this->db->where('status''1');
 
       $user_query $this->db->get();

 
       if ($user_query->num_rows() == 1) {
 
           $this->session->set_userdata('user_id'$user_query->row()->user_id);
 
           $this->user_id $user_query->row()->user_id;
 
           $this->username $user_query->row()->username;
 
           return TRUE;
 
       
 
   }
 
   return FALSE;

Reply


Messages In This Thread
What's better for my code below - by wolfgang1983 - 02-21-2017, 02:41 AM
RE: What's better for my code below - by Wouter60 - 02-21-2017, 07:25 AM
RE: What's better for my code below - by kidino - 03-15-2017, 01:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB