title: Invalid argument foreach
body: <p><strong>View code</strong></p>
  
  <pre><code>&lt;?php foreach($payment as $test){?&gt;
   &lt;tr&gt;
       &lt;td&gt;&lt;?php echo $test-&gt;customerName;?&gt;&lt;/td&gt;
       &lt;td&gt;&lt;?php echo $test-&gt;dateTime;?&gt;&lt;/td&gt;
       &lt;td&gt;&lt;?php echo $test-&gt;amount;?&gt;&lt;/td&gt;
    &lt;/tr&gt;    
   &lt;?php }?&gt;  
  </code></pre>
  
  <p><strong>Controller code</strong></p>
  
  <pre><code>function __construct() {
      parent::__construct();
      $this-&gt;load-&gt;database();
      $this-&gt;load-&gt;model('Income_sales_model');
  }
  
  public function index()
  {
      $this-&gt;data['pja_test'] = $this-&gt;Income_sales_model-&gt;get_all();
      $this-&gt;load-&gt;view('income_sales_view', $data);
  }
  </code></pre>
  
  <p>**AND HERE IS MY ERROR **</p>
  
  <p><a href="http://i.stack.imgur.com/XyJC7.png" rel="nofollow">I'm stuck here I don't know what to do..</a></p>