[eluser]Unknown[/eluser]
So I have had a go at my earlier problem and have made some progress, but can't finish it fully by myself.
I have manged to select data from the tables in my database using the following code:
Code:
$this->db->select("a.artist_name, t.title");
$this->db->from("record_associations AS ra, artists AS a, titles AS t");
$this->db->where("ra.artist_id = a.artist_name AND ra.title_id = t.title");
When I query this in SQL form everything like I expected it to.
I also have the following lines:
Code:
$data['query'] = $this->db->get();
$this->load->view('main_view', $data);
To my View:
Code:
<?php if ($query->num_rows() > 0): ?>
<?php foreach($query->result() as $row): ?>
<p><?=$row->title?></p>
<h3><?=$row->artist_name?></h3>
<hr/>
<?php endforeach; ?>
Which should display my artists and titles, but it seems that $query has no rows and I don't think that the data from my db is being sent correctly. This view has worked before when I sent a single specific table.
Anyone understand where I have gone wrong?