Codice PHP:
$mese = array();
for (
$i=1$i<=31; ++$i) {
  
$mese[$i] = 0;
}
// qui fai la fetch come hai già fatto