[eluser]bertcarremans[/eluser]
Hi CroNiX,
thanks for the quick answer. Unfortunately, I can't get it to work.
My controller contains this code:
Code:
$show = $this->shows_model->get_show($id);
if ($show['photo_album_id'] !== null) {
$data['photos'] = $this->media_model->get_photo_album($show['photo_album_id']);
}
In the show_model I have:
Code:
function get_show($id) {
$query = $this->db->query('SELECT * FROM shows WHERE id = '.$id);
return $query->row();
}
and in the media_model:
Code:
function get_photo_album($id) {
$query = $this->db->query('SELECT * FROM photos WHERE album_id = '.$id);
return $query->result_array();
}
When I load the page I get the error: Fatal error: Cannot use object of type stdClass as array in C:\xampp\htdocs\ambassadors\application\controllers\site.php on line 200
So I cannot use
as an array. Does this have something to do with the fact that I return the query result as $query->row()?
Thanks!