[eluser]kwhitaker[/eluser]
Good afternoon all,
So I've got three tables - items, images and associations, and I need to write a view that displays each item with the image that it's associated with.
Here's how the logic of the tables works:
Each item can only have one image, but each image can be associated with multiple items. The associations table takes the itemid and pairs it with an imageid.
Now I could write the items query in my controller, and then write the thumbs query in my view, but that wouldn't be very MVC, would it?
So right now I have this code:
Code:
$data['query'] = $this->db->get('items');
$this->load->view('view_items', $data);
How would I use the items query to populate a thumbs query for each item and then pass that data onto the view?
Any help is appreciated.