• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Session vs Query Help

Okay, So I have the following info in session:
$session['id'] = $this->session->userdata('id');
        $session['firstName'] = $this->session->userdata('firstName');
        $session['lastName'] = $this->session->userdata('lastName');
        $session['email'] = $this->session->userdata('email');
        $session['address'] = $this->session->userdata('address');
        $session['address2'] = $this->session->userdata('address2');
        $session['city'] = $this->session->userdata('city');
        $session['state'] = $this->session->userdata('state');
        $session['country'] = $this->session->userdata('country');
        $session['postal'] = $this->session->userdata('postal');
        $session['home'] = $this->session->userdata('home');
        $session['business'] = $this->session->userdata('business');
        $session['cell'] = $this->session->userdata('cell');
        $session['profile'] = $this->session->userdata('profile');

Which works great, but of course, every record has the same data. I created a query that pulls based on the id of the record and tryed to return it to the view:

function profile(){
        $data = $this->db->get('users');        
        $this->load->view('profile', $data);
This is supposed to give users the profile they click from the search, but it pulls the session data unfortunetly, whose scope is overriding my query results.

Any suggestions here on how i can pull the data more explicitly in the view?

Can you post both the controller code and view code?

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.