I have the following query:
public function get_stuff() {
$query = $this->db->query(
'SELECT entry_type, COUNT(entries.type_id) AS totals
FROM entries
LEFT JOIN type ON entries.type_id = type.type_id
GROUP BY entries.type_id'
);
return $query->result();
}
I used it to create a bar chart, works just fine. Thing is, I want to display another chart ( this time a pie chart ) in the same page that will use rows number 5 and 7 ( so, I believe it would be position 4 and 6 of the result array ). I know I could simply make another query, but I don't think it would be the optimal choice. How can I echo something like:
$data = $this->test_model->get_stuff();
echo $data->row(4)->totals;
Also, can I have multiple returns in my model? lets say I have $query1; $query2; and $query3; What's the correct way to return and access each query in my controller?
Thanks in advance.