![]() |
Displaying results from a Left Join - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Displaying results from a Left Join (/showthread.php?tid=8781) |
Displaying results from a Left Join - El Forum - 05-30-2008 [eluser]Chris Williams[/eluser] I'm trying to get this query to display. Code: $this->db->select('*'); I'm using this in the view file: Code: <?php foreach ($query->result() as $row): ?> But I'm getting this error: Message: Undefined variable: query What am I missing? Displaying results from a Left Join - El Forum - 05-30-2008 [eluser]gtech[/eluser] try: Code: $this->load->view('reports_view', array('query'=>$query)); load view expects an associative array and the keys get broken down into variables. Displaying results from a Left Join - El Forum - 05-31-2008 [eluser]Chris Williams[/eluser] That worked great! Thanks! Displaying results from a Left Join - El Forum - 05-31-2008 [eluser]gtech[/eluser] no probs! quite a lot of people get stuck or miss an obvious mistake when passing parameters to the view. |