Welcome Guest, Not a member yet? Register   Sign In
What am I doing wrong? DB, select, array
#1

[eluser]ZioN[/eluser]
I want to pass information from a database table to a view, but I cannot get it to pass over the result.

Controller (acp):
Code:
public function get_users(){
   $this->load->model('users_model');
  
   if ($this->users_model->get_users_model()){
   print_r ($data);
   //redirect('acp/users/manage_users', $test);
   }
   else{
//
   }
  }

Model (users_model):
Code:
public function get_users_model(){
  $query = $this->db->get('users');
  
  if ($query){ // if succesful
  $data = $query->result();
  return $data;
  }
  else{ // if not successful
   return false;
  }
}

A print_r (to test if the $data contains variables) on the model works, but it will not give the data back to the controller and thus not to the view.


Messages In This Thread
What am I doing wrong? DB, select, array - by El Forum - 09-18-2013, 03:26 AM
What am I doing wrong? DB, select, array - by El Forum - 09-18-2013, 03:40 AM
What am I doing wrong? DB, select, array - by El Forum - 09-18-2013, 06:22 AM
What am I doing wrong? DB, select, array - by El Forum - 09-18-2013, 06:26 AM
What am I doing wrong? DB, select, array - by El Forum - 09-18-2013, 07:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB