I try to count how many were sold by the month and get one Array.
$q = SELECT COUNT(id) AS January FROM tableName WHERE status='sold' AND month = '1'
UNION
SELECT COUNT(id) AS February FROM tableName WHERE status='sold' AND month = '2'
$row = mysqli_fetch_array(mysqli_query($connection, $q));
print_r($row);
UNION don't work, when I'm trying print_r(array), I get result
[Jenuary] => 200
How do I get one array in both months?
I want result:
[January] => 200,
[February] => 221