Welcome Guest, Not a member yet? Register   Sign In
[Solved] Problem with User section
#2

Get the user information from your database, preferrably by using a model.
Call the model function from within your controller.
Then, let your controller output the data by loading a view.

Basic example

Model:
PHP Code:
public function get_user($id)
{
 
 $query $this->db->where('id',$id)->get('users');
 
 return $query->row();


Controller:
PHP Code:
public function show_user($id)
{
 
  $this->load->model('user_model');
 
  $data['record'] = $this->user_model->get_user($id);
 
  $this->load->view('user_detail',$data);


View:
Code:
<p><?= $record->id;?></p>
<p><?= $record->name;?></p>
<p><?= $record->pseudo;?></p>
Reply


Messages In This Thread
[Solved] Problem with User section - by wendaf - 07-31-2017, 02:05 PM
RE: Problem with User section - by Wouter60 - 08-01-2017, 06:45 AM
RE: Problem with User section - by wendaf - 08-01-2017, 08:37 AM
RE: Problem with User section - by Wouter60 - 08-01-2017, 11:11 AM
RE: Problem with User section - by wendaf - 08-01-2017, 02:00 PM
RE: Problem with User section - by jarmen_kell - 08-01-2017, 06:52 PM
RE: Problem with User section - by wendaf - 08-02-2017, 02:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB