Welcome Guest, Not a member yet? Register   Sign In
Session Problem
#6

(04-29-2017, 10:57 AM)webdev25 Wrote: There may be a better way to do this depending on where and how you're getting $result, see if something like this helps:

PHP Code:
if( $result->num_rows() ) {
 
 
    $user $result->row();

 
     $this->session->set_userdata(array(
 
          'user_id' => $user->user_id,
 
          'user_name' => $user->user_name,
 
          'role' => $user->role,
 
          'cate_permission' => $user->cate_permission,
 
          'password' => $user->password,
 
          'email' => $user->email,
 
          'pages_permissions' => $user->pages_permissions,
 
          'show_company_detail' => $user->show_company_detail,
 
          'account_status' => $user->account_status,
 
          'logged_in' => true,
 
     ));



i am getting the result through following query 

Code:
$this->db->where('username', $username);
$this->db->where('password', $password);
$result = $this->db->get('tableName');
Reply


Messages In This Thread
Session Problem - by Attiq - 04-29-2017, 03:55 AM
RE: Session Problem - by PaulD - 04-29-2017, 09:45 AM
RE: Session Problem - by Attiq - 04-30-2017, 12:23 AM
RE: Session Problem - by webdev25 - 04-29-2017, 10:57 AM
RE: Session Problem - by Attiq - 04-30-2017, 12:29 AM
RE: Session Problem - by Attiq - 04-30-2017, 01:29 AM
RE: Session Problem - by arisroyo - 04-29-2017, 05:14 PM
RE: Session Problem - by Attiq - 04-30-2017, 12:44 AM
RE: Session Problem - by Attiq - 04-30-2017, 01:24 AM
RE: Session Problem - by InsiteFX - 04-30-2017, 04:00 AM
RE: Session Problem - by Attiq - 04-30-2017, 06:36 AM
RE: Session Problem - by PaulD - 04-30-2017, 04:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB