05-03-2012, 09:56 AM
[eluser]CroNiX[/eluser]
Also your original problem was because you used:
instead of
That's why you got "undefined property" and it never entered the loop, which made $resultarray undefined as it never got created (but you return it anyway). You should create the $resultarray array (empty) just before the foreach loop where you populate it to prevent that.
Also your original problem was because you used:
Code:
foreach ($q->result as $row) {
Code:
foreach ($q->result() as $row) { //result() is a method, not a property.