title: How to get month name by month number inside the query using mysqli?
body: <p>I'm trying to get the count of added records by month. Following query is working fine </p>
  
  <pre><code>SELECT    COUNT(*) AS count_by_month, MONTH(date_added) AS in_month
  FROM      `promotion` 
  WHERE     YEAR(date_added) = '2016' 
  GROUP BY  MONTH(date_added)
  </code></pre>
  
  <p>But above query is returning month number in the result, I wanted to get the month name like <code>Jan</code>,<code>Feb</code> instead of number. I tried following trick but it does not working.</p>
  
  <pre><code>    SELECT    COUNT(*) AS count_by_month, 
      MONTH(date_added) AS in_month, MONTHNAME(STR_TO_DATE(in_month, '%m'));
      FROM      `ws_promotion` 
      WHERE     YEAR(date_added) = '2016' 
      GROUP BY  MONTH(date_added)
  </code></pre>
  
  <p>Can anyone guide me how can fix the issue, i would like to appreciate if someone guide me regarding this. Thank You.</p>