[eluser]Ignis Avis[/eluser]
I want to display existing data in the fields when i will go to edit page.
Here is my model function.
Code:
public function edit_user($member_id)
{
$this->db->select('fullname','country','district','address','nominee_name','nominee_relation','mobile_no','password','bank_acc_no','bank_acc_name','bank_name','branch_name');
$this->db->limit('1');
return $this->db->get_where('user', array('member_id'=> $member_id))->row();
}
Here is the controller function.
Code:
function edit_profile()
{
$data['title']= 'Edit Profile';
$member_id = $this->session->userdata('member_id');
$this->load->model('user_model','',TRUE);
$data['row'] = $this->user_model->edit_user($member_id);
$this->load->view('edit_profile.php', $this->data);
}
and in my view file for a sing field I am using this.
Code:
<input type="text" value="<?php echo $row['full_name'];?>"/>
But I am getting following error.
Code:
Severity: Notice
Message: Undefined variable: row
Filename: views/edit_profile.php
I am new in codeigniter and can't figure out why this is happening.