Display 2 tables on codeigniter
<p>im new to codeigniter and php, need some enlightment to display 2 tables with mvc method. just displaying two tables in one page (camera and visitor table). here is my code</p>

<p>Model :</p>

<pre><code>function m_report() {
        $camera = $this-&gt;db-&gt;get('camera');
        return $camera-&gt;result();
        $report = $this-&gt;db-&gt;get('visitor');
        return $report-&gt;result();
    }
</code></pre>

<p>View:</p>

<pre><code>&lt;?php foreach($data1 as $report){ ?&gt;
               &lt;tr&gt;      
                  &lt;td&gt;&lt;?php echo $report-&gt;Country; ?&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;?php echo $report-&gt;Days; ?&gt;&lt;/td&gt;
                &lt;/tr&gt;
&lt;?php } ?&gt;

&lt;?php foreach($data_camera as $camera){ ?&gt;
                   &lt;tr&gt;      
                      &lt;td&gt;&lt;?php echo $camera-&gt;cameratype; ?&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                  &lt;?php } ?&gt;
</code></pre>

<p>Controller :</p>

<pre><code>function report(){
        $data['data_camera']=$this-&gt;m_data-&gt;m_report();
        $data1['data1']=$this-&gt;m_data-&gt;m_report();
        $this-&gt;load-&gt;view('v_report',$data,$data1);


}
</code></pre>

<p>the problem is, i can display camera table but visitor got error Message: Undefined variable: data1</p>

<p>Can anyone help me to figure it out? Much appreciate</p>