[eluser]jrichey[/eluser]
I want to create a detail page where the user has selected a single item from a list.
Here is my controller function:
function edit_view(){
$data['title'] = 'Edit Domain';
$this->db->where('id', $this->uri->segment(3));
$data['query'] = $this->db->get('domains');
$this->load->view('domain_edit', $data);
}
In my view, I am showing the data in form fields for editing such as:
<input type="text" name="domain" value="data value goes here" />
Right now I have it working by using a foreach statement, even though I know it's only going to return one row. Is there a better way to do this other than using a foreach?