On returning $query->result_array();, sometime I get multiple single arrays like this:
Array
(
[user_id] => 32
[username] => johnd
[cat_id] => 7
)
Array
(
[user_id] => 33
[username] => Janed
[cat_id] => 6
)
While other times, I get multidimensional arrays like this:
Array
(
[0] => Array
(
[user_id] => 33
[username] => Janed
[cat_id] => 6
)
[1] => Array
(
[user_id] => 32
[username] => Johnd
[cat_id] => 7
)
)
Is it something to do with the query, is there a specific reason for this?
result_array?result_arrayalways returns a 2D array. Depending on how you loop/view it, it may look different, but it's not.