Welcome Guest, Not a member yet? Register   Sign In
How to fetch multy records
#7

[eluser]CroNiX[/eluser]
Because when you return result_array(), it's an array, not an object.

Change it to return $query->result() if you want an object.

also, in your view, you will want to loop over $categories
Code:
<?php foreach($categories as $category): ?>
<tr>
  <td class='td-mid'><b>&lt;?php echo $category->title; ?&gt;</b></td>
  <td class='td-mid'>&lt;?php echo $category->description; ?&gt;</td>
  <td class='td-mid'>&lt;?php echo $category->amount; ?&gt;</td>
</tr>
&lt;?php endforeach; ?&gt;


Messages In This Thread
How to fetch multy records - by El Forum - 08-17-2012, 11:51 AM
How to fetch multy records - by El Forum - 08-17-2012, 01:42 PM
How to fetch multy records - by El Forum - 08-17-2012, 02:05 PM
How to fetch multy records - by El Forum - 08-17-2012, 02:14 PM
How to fetch multy records - by El Forum - 08-17-2012, 02:51 PM
How to fetch multy records - by El Forum - 08-17-2012, 03:02 PM
How to fetch multy records - by El Forum - 08-17-2012, 03:06 PM
How to fetch multy records - by El Forum - 08-17-2012, 03:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB