I have created following table in mysql
I want to retrieve one of the field i.e abstract or author or Title by using id dynamically in view field. These are my model, controller and view code. Model:This is my model
$this->db->select("*");
$this->db->limit(10);
$this->db->from("abcde");
$query = $this->db->query("SELECT * FROM abcde ORDER BY DocumentID ASC");
Controller: this is my controller here
$this->load->model("Sample_model");
$data["fetch_data"] = $this->Sample_model->fetch_data();
$data['view']='services_view';
$this->load->view('load_view', $data);
return $query;
View:This is my view page
<?php
if($fetch_data->num_rows() > 0)
{
foreach($fetch_data->result() as $row)
{
?>
<tr>
<td><?php echo $row->Abstract
</tr>
<?php
}
}
?>
</table>
The above view is displaying all the record of abstract.I want to use ID in view so that i can get specific abstract in one line.
for example display abstract where id=1 or display author where id 3.Important point is here that i want to use id in view of the codeigniter. I will be grateful to you for your help.