$stmt = $this->db->query("
SELECT COUNT(*) AS total, status as tipo FROM tabela1 WHERE status=1 GROUP BY SEXO UNION ALL
SELECT COUNT(*) AS total, status as tipo FROM tabela2 WHERE status=1 GROUP BY FAIXA_ETARIA
");
$total = $stmt->fetchAll();
how to return an array like this (two arrays with all values referring to the select):
$total['sexo'] = "todos os valores referentes a este select dentro desta array"
$total['FAIXA_ETARIA'] = "todos os valores referentes a este select dentro desta array"
Is there a way to do this without doing 2 separate queries?