I need to generate an url link for a view and display data from database into this view. My main view is Artists/Singers and it has a table of singers. Each singer should be a link which when I press leads me to his Artist page with his albums, biography and songs.
I need to do this in Code Igniter and of course I can read the docs but will need a week or so and I have only 2 days.
Here is my code:
$this->load->database();
$artists = $this->db->query('SELECT a.name, a.date, c.name FROM artist as a, country as c WHERE a.country_id=c.id');
echo "<tr><td>Artist</td><td>Year</td><td>Country</td></tr>";
foreach ($artists->result() as $row)
{
//echo $config['base_url'];
echo "<tr>";
echo "<td><a href=\"/Artist.php\">" . $row->name . "</a></td>";
echo "<td>" . $row->date . "</td>";
echo "<td>" . $row->name . "</td>";
echo "</tr>";
}
echo "</table>";