[eluser]E303[/eluser]
I am trying to get the exhibitionId from exhibitions depending on what exhibition is viewed. Then with that exhibitionsId I want to search the gallery table to see if their is a gallery.
Code:
$url = $this->uri->segment(3);
$this->db->select('exhibitionsId');
$this->db->from('exhibitions');
$this->db->where('url',$url);
$exhibitions_list = $this->db->get();
foreach ($exhibitions_list->row() as $row)
{
$this->db->select('url, title');
$this->db->from('galleries');
$this->db->where('exhibitId', $row['exhibitionsId']);
$galleryExhibitions_data = $this->db->get();
return $galleryExhibitions_data->result_array();
}
Nothing displays like there is no record yet there is. So when I run
Code:
echo $row['exhibitionsId'];
I get the number 2. The correct number should be 25. There is no record with the number 2 so I am not sure what is happening. It seems when I try to echo out anything from the first query I get the number 2 and the result.
Thanks in advance