result as array vs. object |
[eluser]roadie[/eluser]
Hi guys! I have this function but I want to change it to get the result as objects not arrays. I've been trying for a while but can't figure it out. I'd appreciate your help! Model: categories_model.php Code: function get_bCategories(){ Controller: Code: $data['bCategories'] = $this->categories_model->get_bCategories(); View: Code: <?php foreach($bCategories as $bCategory): ?>
[eluser]SPeed_FANat1c[/eluser]
If I understand well you should use $result = $query->result() instead of $result = $query->result_array(); http://ellislab.com/codeigniter/user-gui...sults.html |
Welcome Guest, Not a member yet? Register Sign In |