How to combine two count queries in one
I've these two queries and I need to combine in a unique:
<?php
$rsChartInfo = new WA_MySQLi_RS("rsChartInfo",$connTest,0);
$rsChartInfo->setQuery("SELECT MONTH(date_created) MONTH, COUNT(*) COUNT FROM qr_forms_info WHERE YEAR(date_created)=YEAR(CURDATE()) GROUP BY MONTH(date_created)");
$rsChartInfo->execute();?>
<?php
$rsChartInfoPrev = new WA_MySQLi_RS("rsChartInfoPrev",$connTest,0);
$rsChartInfoPrev->setQuery("SELECT MONTH(date_created) MONTH, COUNT(*) COUNT FROM qr_forms_info WHERE YEAR(date_created)=YEAR(CURDATE()) -1 GROUP BY MONTH(date_created)");
$rsChartInfoPrev->execute();
?>
The result should be (first column "month", second "count current year records", third "count last year records"):
1 | 40 | 23
2 | 5 | 123
3 | 56 | 89
4 | 67 | 34
5 | 12 | 87
6 | 54 | 76
7 | 234 | 75
8 | 23 | 493
9 | 74 | 456
10 | 0 | 562
11 | 0 | 68
12 | 0 | 345
Is it possible?