title: Get totals of each month a year including the month with no result
body: <p>I want to echo the total of invoices created per month. </p>
  
  <p>Code below is working so far but I need a 0 if there is no result in a month.</p>
  
  <pre><code>$sql = "SELECT MONTH( invoice_date ) AS MONTH, SUM(`invoice`.`total`) as total
      FROM `invoices`
      WHERE YEAR(invoice_date) = '2019'
      GROUP BY MONTH(invoice_date)";
  $result = mysqli_query($con,$sql);
  while($data = mysqli_fetch_array($result))
  {
      $total = $data['total'];
      $month = $data['month'];
  }
  </code></pre>
  
  <p>What I want is this:</p>
  
  <pre><code>Jan 500
  Feb 300
  Mar 0
  Apr 500
  etc...
  </code></pre>
  
  <p>What I get is this</p>
  
  <p>Jan 500
  Feb 300
  Apr 500</p>
  
  <p>... because there is no entry with Mar in my DB.</p>
  
  <p>If I do the query in a loop for each month it's working fine but I know I shouldn't use it this way and there is a better way!?</p>