1
$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 for 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"
there is a way to do this without making 2 separate querys?