[eluser]Unknown[/eluser]
Thank you for your reply and well wishes.
I kind of understand what you are saying in idea 1. It is bit unclear to me.
With the help of the documentation and the blog screencast tutorial I have been able to get the following so far. Which displays the correct single record in the "single view" when a link is clicked in the "category view":
Please keep in mind this is very much in development code, and for illustration purposes only. Do not use on a live site unless you know what you are doing.
In the "category view"
Unfortunately I can't get the php link I wrote to post properly, so please bear with me until I figure that out.
a link with "$row->id" in the href path so you get for example the result "www.yourdomain.com/path/to/2".
Where in "row->id" "id" the primary key of the table is. Although I would like to display the title of the article for pretty url's.
So you get something like this at its basic level:
Code:
<?php foreach($query->result() as $row): ?>
link here
<?php endforeach; ?>
In the "single view"
Code:
<?php
$article_id = $this->uri->segment(3, 0);
$query = $this->db->query("SELECT * FROM `database_table`");
if ($query->num_rows() > 0)
{
$row = $query->row($article_id-1);
}
?>
<h2><?=$row->title?></h2>
<p><?=$row->story?></p>
Please note that in this example the segment in the variable "$article_id" needs to equal the segment location in the link in the "category view".
The code above is excluding any modrewrites and routes.