• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unusual ActiveRecord Result

#1
[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


Messages In This Thread
Unusual ActiveRecord Result - by El Forum - 07-01-2008, 12:06 AM
Unusual ActiveRecord Result - by El Forum - 07-01-2008, 12:45 AM
Unusual ActiveRecord Result - by El Forum - 07-01-2008, 01:11 AM
Unusual ActiveRecord Result - by El Forum - 07-01-2008, 01:19 AM
Unusual ActiveRecord Result - by El Forum - 07-01-2008, 01:22 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.