I had met a basic problem that i want to show specific ‘account’ not all account data from database.
Just like the pic Here, If the user’s account is 'chiquitta'
When user need to edit her account setting
It should only show her account information not all of the account information from database.
I had try to solve this problem but it still show all account ~ Did I miss something?
[my controller]
function index($id = false)
{
$data['page_title'] = lang('admins');
$data['admins'] = $this->auth->get_admin_specific($id);
$this->load->view($this->config->item('admin_folder').'/admins', $data);
}
[my model]
function get_admin_specific($id)
{
$this->CI->db->select('*');
if ($id)
{
$this->CI->db->where('id', $id);
}
$result = $this->CI->db->get('admin');
$result = $result->result();
return $result;
}
[my view]
<?php foreach ($admins as $admin):?>
<?php echo $admin->account; ?>
<?php endforeach; ?>