I have a databse class which returns an array of objects. I am trying to get multiple bits of data from this single query, in order to prevent having to run three queries.
I have stumbled upon array_count_values()
[ http://uk3.php.net/manual/en/function.array-count-values.php ] which will be perfect for catching various bits of data about the result set which I can use. Although I can't figure out how to cast all the second dimensions into arrays without having to just foreach through the whole return which would be a little bad I think.
Does anyone have any ideas how I can convert my array of objects, as a whole into an array, to allow this game changing function to do it's magic?
Array
(
[0] => stdClass Object
(
[message_id] => 23185
[from_profile] => 3165
[to_profile] => 962
[parent_message_id] => 17111
[date_sent] => 2011-02-23 05:48:25
[subject] => RE: hi
)
// etc
There is also the issue that I've just thought of whilst typing this question, sods law eh? That will the function be able to parse multiple dimensions?