[eluser]Laranjeiro[/eluser]
I have found the solution.
The problem wasn't that complicated. I am just not used to CI yet.
What I wanted to do was when I clicked the journal link, it appear the last submitted information.
I solved it like
Code:
// last headline
$this->db->select_max('id');
$query = $this->db->get('journal');
foreach ($query->result() as $row):
$last = $row->id;
endforeach;
$this->db->where('id',$last);
$data['query2'] = $this->db->get('journal');
For the headlines list
Code:
// headlines
$this->db->select('title,id');
$this->db->from('journal');
$this->db->order_by("id", "desc");
$data['query'] = $this->db->get();
For the selected headline
Code:
//selected headline
$this->db->where('id',$this->uri->segment(3));
$data['query2'] = $this->db->get('journal');
I divide it in two functions. One that would show the last inserted item and another for the selected item.
And that's it.
Thanks for all the help